Forum Stats

  • 3,815,831 Users
  • 2,259,097 Discussions
  • 7,893,270 Comments

Discussions

RMAN Duplicate : How will RMAN search for the source DB's backups within tapes ?

PeaceMonger
PeaceMonger Member Posts: 28 Blue Ribbon

DB version : 12.1

OS : RHEL 7.9


I have my production DB ORCLP running in server A.

I need to create a clone of ORCLP in another Linux server B and name the newly cloned database ORCLT. I thought of using RMAN's DUPLICATE command for this.

The backups are in tapes with HP (now Micro Focus) Data protector acting as MML.


To run the RMAN duplicate, I have my pfile ready and I have the below command.

I have added the MML layer stuff in the allocate auxiliary channel commands as shown below.


From the syntax DUPLICATE TARGET DATABASE TO ORCLT, I gather that TARGET DATABASE means the source database.


And I am connecting to the RMAN catalog. 

But, how will RMAN search for the backup pieces of ORCLP database within the tapes ?

I mean, regardless of whether I run a regular RMAN restore + recover or duplicate, RMAN should find backup pieces of ORCLP in the tapes. 

How will RMAN do that ?


BTW, any other improvements in below rman duplicate command is welcome.



export ORACLE_SID=ORCLT
SQL >startup nomount pfile=/path/to/pfilefor_ORCLT.ora

rman auxiliary / catalog rman_ctlg/[email protected]_tns 

   
run {
allocate auxiliary channel ch00 type 'sbt_tape' PARMS 'SBT_LIBRARY=/dboracle/omni/lib/libob2oracle8_64bit.so';
allocate auxiliary channel ch01 type 'sbt_tape' PARMS 'SBT_LIBRARY=/dboracle/omni/lib/libob2oracle8_64bit.so';
allocate auxiliary channel ch02 type 'sbt_tape' PARMS 'SBT_LIBRARY=/dboracle/omni/lib/libob2oracle8_64bit.so';
SET UNTIL time "to_date('28-NOV-2021 17:45:00','DD-MON-YYYY hh24:MI:SS')";
set newname for database to '/dbdata/ORCLT/datafile/%b’;
duplicate target database to ORCLT nofilenamecheck;
logfile
group 1 (‘/dbdata/ORCLT/redoXCENT1.log’) size 512M,  
group 2 (‘/dbdata/ORCLT/redoXCENT2.log’) size 512M,
group 3 (‘/dbdata/ORCLT/redoXCENT3.log’) size 512M;
}

Answers

  • flying_penguin
    flying_penguin Member Posts: 255 Bronze Badge

    From the syntax DUPLICATE TARGET DATABASE TO ORCLT, I gather that TARGET DATABASE means the source database.


    Yes. In RMAN DUPLICATE terminology, target means the source database.



    And I am connecting to the RMAN catalog. 

    But, how will RMAN search for the backup pieces of ORCLP database within the tapes ?

    I mean, regardless of whether I run a regular RMAN restore + recover or duplicate, RMAN should find backup pieces of ORCLP in the tapes. 

    How will RMAN do that ?


    If I understand correctly, since this is RMAN duplicate, when you issue the below command and you are connected to the catalog; so RMAN can search for backup pieces of ORCLP ('target') withing tapes and find the needed backup pieces.  


    duplicate target database to ORCLT nofilenamecheck;



    On the other hand, if this was a plain RMAN restore + recover, you should use the 'SET DBID=<DB ID of ORCLP database>' command to let RMAN know what is the source DB so that RMAN can look for this DB's backup pieces to do the restore + recover


    set dbid=97448036
    RUN {
    ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE' <MML PARAMETERS>;
    .
    .
    ALLOCATE CHANNEL ch07 TYPE 'SBT_TAPE' <MML PARAMETERS>;
    
    
    SET UNTIL time "to_date('22-12-2021 17:45:00','DD-MM-YYYY hh24:MI:SS')";
    RESTORE DATABASE;
    RECOVER DATABASE;
    }