5
8/7/2019 DUPLICATE WITHOUT CONNECTING http://slidepdf.com/reader/full/duplicate-without-connecting 1/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

DUPLICATE WITHOUT CONNECTING

  • Upload
    nassr50

  • View
    220

  • Download
    0

Embed Size (px)

Citation preview

Page 1: DUPLICATE WITHOUT CONNECTING

8/7/2019 DUPLICATE WITHOUT CONNECTING

http://slidepdf.com/reader/full/duplicate-without-connecting 1/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 theTARGET 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 onlyarchivelogs 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 archived

Page 2: DUPLICATE WITHOUT CONNECTING

8/7/2019 DUPLICATE WITHOUT CONNECTING

http://slidepdf.com/reader/full/duplicate-without-connecting 2/5

released 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 set

input 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 set

input 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_TAG20090819T 083537_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>

  

Page 3: DUPLICATE WITHOUT CONNECTING

8/7/2019 DUPLICATE WITHOUT CONNECTING

http://slidepdf.com/reader/full/duplicate-without-connecting 3/5

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 recover y_area]$ ls -ltr -rw-rw----1      95744 Aug 19 09:18 o1_mf_annnn_TAG20090819T083713_58pc8t18_.bkp-rw-rw---- 169371392 Aug 19 09:18 o1_mf_annnn_TAG20090819T083530_58pc5llk_.bkp-rw-rw---- 11466580992 Aug 19 09:19 o1_mf_nnndf_TAG20090819T083537_58pc5t b6_.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=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

Page 4: DUPLICATE WITHOUT CONNECTING

8/7/2019 DUPLICATE WITHOUT CONNECTING

http://slidepdf.com/reader/full/duplicate-without-connecting 4/5

 $ 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#sthref1824 >

.Oracle Database Backup and Recovery User's Guide

11g Release 2 (11.2)

Part Number E10642-04

.Chapter 24 Duplicating a Database

.

  

References

Page 5: DUPLICATE WITHOUT CONNECTING

8/7/2019 DUPLICATE WITHOUT CONNECTING

http://slidepdf.com/reader/full/duplicate-without-connecting 5/5

htt :// l l / / / / / / ht

Rel ed

Products

y  Oracl atabase Products > Oracle Database > Oracle Database > Oracle

Server - Enterpr ise Edition

 

Back to top