You are on page 1of 5

RMAN 11GR2 : DUPLICATE WITHOUT CONNECTING TO TARGET

DATABASE [ID 874352.1]

  Modified 04-FEB-2011     Type HOWTO     Status  


REVIEWED

In this Document
  Goal
  Solution
  References

Applies to:
Oracle Server - Enterprise Edition - Version: 11.2.0.2 to 11.2.0.2 - Release: 11.2 to
11.2
Information in this document applies to any platform.

Goal
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.

Solution

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:28
current log archived
released channel: ORA_SBT_TAPE_1
using channel ORA_DISK_1
skipping archived log file /u01/app/oracle/flash_recovery_area/V11/ar
chivelog/20
09_08_18/o1_mf_1_27_58nd798o_.arc; already backed up 1 time(s)
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=28 RECID=28 STAMP=695260837
input archived log thread=1 sequence=29 RECID=29 STAMP=695291729
channel ORA_DISK_1: starting piece 1 at 2009/08/19 08:35:30
channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:35:37
piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_0
8_19/o1_mf_
annnn_TAG20090819T083530_58pc5llk_.bkp tag=TAG20090819T083530 comment
=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 2009/08/19 08:35:37
 
Starting backup at 2009/08/19 08:35:37
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00002 name=/oradata/v11/sysaux01.dbf
input datafile file number=00001 name=/oradata/v11/system01.dbf
input datafile file number=00003 name=/oradata/v11/undo01.dbf
input datafile file number=00005 name=/oradata/v11/example01.dbf
input datafile file number=00004 name=/oradata/v11/users01.dbf
channel ORA_DISK_1: starting piece 1 at 2009/08/19 08:35:38
channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:37:13
piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_0
8_19/o1_mf_
nnndf_TAG20090819T083537_58pc5tb6_.bkp tag=TAG20090819T083537 comment
=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
Finished backup at 2009/08/19 08:37:13
 
Starting backup at 2009/08/19 08:37:13
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=30 RECID=30 STAMP=695291833
channel ORA_DISK_1: starting piece 1 at 2009/08/19 08:37:14
channel ORA_DISK_1: finished piece 1 at 2009/08/19 08:37:15
piece handle=/u01/app/oracle/flash_recovery_area/V11/backupset/2009_0
8_19/o1_mf_
annnn_TAG20090819T083713_58pc8t18_.bkp tag=TAG20090819T083713 comment
=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2009/08/19 08:37:15
 
Starting Control File and SPFILE Autobackup at 2009/08/19 08:37:15
piece handle=/u01/app/oracle/flash_recovery_area/V11/autobackup/2009_
08_19/o1_mf
_s_695291835_58pc8w10_.bkp comment=NONE
Finished 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_area

3) 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_.bkp

All 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=v11dup
db_unique_name=v11dup
db_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=100G
diagnostic_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.

Reference:
<
http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#s
thref1824 >
.
Oracle Database Backup and Recovery User's Guide
11g Release 2 (11.2)
Part Number E10642-04
.
 Chapter 24 Duplicating a Database
.

References
http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmdupdb.htm

Related

Products

 Oracle Database Products > Oracle Database > Oracle Database > Oracle
Server - Enterprise Edition

Back to top

You might also like