RMAN 11GR2 : DUPLICATE WITHOUT CONNECTING TO TARGET DATABASE [ID 874352.1]
In this Document Goal Solution References
Oracle Server - Enterprise Edition - Version: 11.2.0.2 to 11.2.0.2 - Release: 11.2 to 11.2Information in this document applies to any platform.
The following note guides a DBA in performing an RMAN duplicate to a new server without connecting to the target database or a recovery catalog. This is an Oracle 11g Release 2 feature called 'backup-based duplication' and is only connecting to the Auxiliary instance, while prior versions required a connection to the TARGET and optional to the RMAN-catalog.
1) In order to be able to perform a duplicate of the target DB you must first have a backup of the database you wish to duplicate.
Note: If you have not backed up your archivelogs recently it may be a good idea to take a backup as previous archivelogs to this backup will not be required in this backupset. RMAN> backup archivelog all;In the steps below we ensure an autobackup of the controlfile is taken and only archivelogs that have not been backed up 1 time are included.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;RMAN> backup database plus archivelog not backed up 1 times; Starting backup at 2009/08/19 08:35:28current log archivedreleased channel: ORA_SBT_TAPE_1using channel ORA_DISK_1skipping archived log file /u01/app/oracle/flash_recovery_area/V11/archivelog/2009_08_18/o1_mf_1_27_58nd798o_.arc; already backed up 1 time(s)channel ORA_DISK_1: starting archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=28 RECID=28 STAMP=695260837input archived log thread=1 sequence=29 RECID=29 STAMP=695291729channel ORA_DISK_1: starting piece 1 at 2009/08/19 08:35:30channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:35:37piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_annnn_TAG20090819T083530_58pc5llk_.bkp tag=TAG20090819T083530 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:07Finished backup at 2009/08/19 08:35:37 Starting backup at 2009/08/19 08:35:37using channel ORA_DISK_1channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile(s) in backup setinput datafile file number=00002 name=/oradata/v11/sysaux01.dbfinput datafile file number=00001 name=/oradata/v11/system01.dbfinput datafile file number=00003 name=/oradata/v11/undo01.dbfinput datafile file number=00005 name=/oradata/v11/example01.dbfinput datafile file number=00004 name=/oradata/v11/users01.dbfchannel ORA_DISK_1: starting piece 1 at 2009/08/19 08:35:38channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:37:13piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_nnndf_TAG20090819T083537_58pc5tb6_.bkp tag=TAG20090819T083537 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:01:35Finished backup at 2009/08/19 08:37:13 Starting backup at 2009/08/19 08:37:13current log archivedusing channel ORA_DISK_1channel ORA_DISK_1: starting archived log backup setchannel ORA_DISK_1: specifying archived log(s) in backup setinput archived log thread=1 sequence=30 RECID=30 STAMP=695291833channel ORA_DISK_1: starting piece 1 at 2009/08/19 08:37:14channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:37:15piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_annnn_TAG20090819T083713_58pc8t18_.bkp tag=TAG20090819T083713 comment=NONEchannel ORA_DISK_1: backup set complete, elapsed time: 00:00:01Finished backup at 2009/08/19 08:37:15 Starting Control File and SPFILE Autobackup at 2009/08/19 08:37:15piece handle=/u01/app/oracle/flash_recovery_area/V11/autobackup/2009_08_19/o1_mf_s_695291835_58pc8w10_.bkp comment=NONEFinished Control File and SPFILE Autobackup at 2009/08/19 08:37:18 RMAN>2) Copy the backupsets from above to your auxiliary server.Example:
/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_annnn_TAG20090819T083530_58pc5llk_.bkp/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_nnndf_TAG20090819T083537_58pc5tb6_.bkp/u01/app/oracle/flash_recovery_area/V11/backupset/2009_08_19/o1_mf_annnn_TAG20090819T083713_58pc8t18_.bkp/u01/app/oracle/flash_recovery_area/V11/autobackup/2009_08_19/o1_mf_s_695291835_58pc8w10_.bkp% scp <file_name> <server_name>:<directory>% scp * aulnxdv2:/recovery_area/In this example I am storing the backuppiece in /recovery_area3) Ensure Files have successfully been copied to new server:
[oracle@aulnxdv2 recovery_area]$ ls -ltr-rw-rw---- 1 95744 Aug 19 09:18 o1_mf_annnn_TAG20090819T083713_58pc8t18_.bkp-rw-rw---- 1 69371392 Aug 19 09:18 o1_mf_annnn_TAG20090819T083530_58pc5llk_.bkp-rw-rw---- 1 1466580992 Aug 19 09:19 o1_mf_nnndf_TAG20090819T083537_58pc5tb6_.bkp-rw-rw---- 1 10059776 Aug 19 09:22 o1_mf_s_695291835_58pc8w10_.bkpAll files generated in the backup have successfully been copied across to the new server.4)Prepare an init.ora for the duplicate database.
v11dup.ora------------db_name=v11dupdb_unique_name=v11dupdb_recovery_file_dest='/recovery_area'control_files='/oradata/v11dup/control01.ctl'audit_file_dest='/oradata/admin/v11dup'compatible='11.2.0.0.0'db_recovery_file_dest_size=100Gdiagnostic_dest='/oradata/admin/v11dup'5) Prepare for duplicate byt starting the auxiliary instance
$ export ORACLE_SID=v11dup $ sqlpplus '/as sysdba' SQL> startup nomount;This will nomount the instance using the initv11dup.ora created.6) Connect and run the duplicate
% rman auxiliary /RMAN> DUPLICATE DATABASE TO dupdb BACKUP LOCATION '/recovery_area/' NOFILENAMECHECK;For Backup-Based Duplication Without a Target and a Recovery Catalog Connection:
All backup and copies necessary for duplication including a control file backup or copy, have to be placed in directory as specified in 'BACKUP LOCATION' In this example it has been placed under '/recovery_area'RMAN will use the parameter BACKUP LOCATION to look for any backups. The most recent datafile and archivelog backups will than restore and recovered. In the above example I have included NOFILENAME check as I am restoring on a new server. This will restore the database to the same file system structure on auxiliary server.Note you are also able to use SET UNTIL TIME if required.Once the duplicate is complete it will open with a resetlogs. At the end of a successful duplicate the DBID is changed.