Sei sulla pagina 1di 7

Duplication to the same Server Using Disk Backups Step 1.

Build your auxiliary database directory structures: mkdir /oracle/oradata/aux1 mkdir /oracle/oradata/aux1/arch cd /oracle/admin mkdir aux1 cd aux1 mkdir pfile dbump udump cdump ls Step 2. Copy the target init.ora file to the auxiliary location. if your target database uses an spfile, you need to create a pfile from the spfile in order capture parameters to move over if you use an spfile at your target, enter the following sql> connect / as sysdba create pfile='/oracle/admin/aux1/init.ora' from spfile; cp initprod.ora /oracle/admin/aux1/pfile/init.ora Step 3. Make all necessary changes to your aux1 init.ora file: db_name=aux1 ########################################### # Diagnostics and Statistics ########################################### background_dump_dest=/oracle/admin/aux1/bdump core_dump_dest=/oracle/admin/aux1/cdump timed_statistics=TRUE user_dump_dest=/oracle/admin/aux1/udump ########################################### # File Configuration ########################################### control_files=("/oracle/oradata/aux1/control01.ctl") instance_name=aux1 db_file_name_convert=('HMDEV','aux1') log_file_name_convert=('HMDEV','aux1') remote_login_passwordfile=exclusive Step 4. Build your aux1 password file Step 5. start the aux1 instance in nomount mode: ORACLE_SID=aux1;export ORACLE_SID sqlplus /nolog sql> connect / as sysdba sql> startup nomount pfile=/oracle/admin/aux1/pfile/initaux1.ora Step 6. Configure your network files for connection to aux1. After making any changes to your listener.ora file, be sure that you bounce your listener, or the

change will not take effect lsnrctl stop lsnrctl start tnsnames.ora aux1 = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 190.2.12.113)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = aux1) ) ) listener.ora SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = PLSExtProc) (ORACLE_HOME = /oracle/product/920 ) (PROGRAM = extproc) ) (SID_DESC = (GLOBAL_DBNAME = hmdev) (ORACLE_HOME = /oracle/product/920) (SID_NAME = hmdev) ) (SID_DESC = (GLOBAL_DBNAME = aux1) (ORACLE_HOME = /oracle/product/920) (SID_NAME = aux1) ) ) STep 7. From RMAN, connect to the target and auxiliary instance and run the dupl icate command ORACLE_SID=HMDEV; export ORACLE_SID rman RMAN> connect target / connected to target database: HMDEV (DBID=289711392) RMAN> connect auxiliary sys/oracle@aux1 connected to auxiliary database: aux1 (not mounted) RMAN> duplicate target database to aux1 pfile=/oracle/product/920/dbs/initaux1.o ra

2> ; Starting Duplicate Db at 04-MAY-04 using target database controlfile instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: sid=11 devtype=DISK printing stored script: Memory Script { set until scn 17929284; set newname for datafile 1 to "/oracle/oradata/aux1/system01.dbf"; set newname for datafile 2 to "/oracle/oradata/aux1/undotbs01.dbf"; set newname for datafile 3 to "/oracle/oradata/aux1/cwmlite01.dbf"; set newname for datafile 4 to "/oracle/oradata/aux1/drsys01.dbf"; set newname for datafile 5 to "/oracle/oradata/aux1/example01.dbf"; set newname for datafile 6 to "/oracle/oradata/aux1/indx01.dbf"; set newname for datafile 7 to "/oracle/oradata/aux1/odm01.dbf"; set newname for datafile 8 to "/oracle/oradata/aux1/tools01.dbf"; set newname for datafile 9 to "/oracle/oradata/aux1/users01.dbf"; set newname for datafile 10 to "/oracle/oradata/aux1/xdb01.dbf"; set newname for datafile 11 to "/oracle/oradata/aux1/T_HEALTH.dbf"; restore check readonly clone database ; } executing script: Memory Script executing command: SET until clause executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME

executing command: SET NEWNAME Starting restore at 04-MAY-04 using channel ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: starting datafile backupset restore channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set restoring datafile 00001 to /oracle/oradata/aux1/system01.dbf restoring datafile 00002 to /oracle/oradata/aux1/undotbs01.dbf restoring datafile 00003 to /oracle/oradata/aux1/cwmlite01.dbf restoring datafile 00004 to /oracle/oradata/aux1/drsys01.dbf restoring datafile 00005 to /oracle/oradata/aux1/example01.dbf restoring datafile 00006 to /oracle/oradata/aux1/indx01.dbf restoring datafile 00007 to /oracle/oradata/aux1/odm01.dbf restoring datafile 00008 to /oracle/oradata/aux1/tools01.dbf restoring datafile 00009 to /oracle/oradata/aux1/users01.dbf restoring datafile 00010 to /oracle/oradata/aux1/xdb01.dbf restoring datafile 00011 to /oracle/oradata/aux1/T_HEALTH.dbf channel ORA_AUX_DISK_1: restored backup piece 1 piece handle=/rman_backups/bkup_HMDEV_14_1 tag=TAG20040505T043000 params=NULL channel ORA_AUX_DISK_1: restore complete Finished restore at 04-MAY-04 sql statement: CREATE CONTROLFILE REUSE SET DATABASE "aux1" RESETLOGS ARCHIVELOG MAXLOGFILES 50 MAXLOGMEMBERS 5 MAXDATAFILES 100 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '/oracle/oradata/aux1/redo01.log' ) SIZE 104857600 REUSE, GROUP 2 ( '/oracle/oradata/aux1/redo02.log' ) SIZE 104857600 REUSE, GROUP 3 ( '/oracle/oradata/aux1/redo03.log' ) SIZE 104857600 REUSE DATAFILE '/oracle/oradata/aux1/system01.dbf' CHARACTER SET AL32UTF8 printing stored script: Memory Script { switch clone datafile all; } executing script: Memory Script datafile 2 switched to datafile copy input datafilecopy recid=1 stamp=525293003 01.dbf datafile 3 switched to datafile copy input datafilecopy recid=2 stamp=525293003 01.dbf datafile 4 switched to datafile copy input datafilecopy recid=3 stamp=525293003 .dbf datafile 5 switched to datafile copy input datafilecopy recid=4 stamp=525293003 01.dbf datafile 6 switched to datafile copy input datafilecopy recid=5 stamp=525293003 dbf filename=/oracle/oradata/aux1/undotbs filename=/oracle/oradata/aux1/cwmlite filename=/oracle/oradata/aux1/drsys01 filename=/oracle/oradata/aux1/example filename=/oracle/oradata/aux1/indx01.

datafile 7 switched to datafile copy input datafilecopy recid=6 stamp=525293003 filename=/oracle/oradata/aux1/odm01.d bf datafile 8 switched to datafile copy input datafilecopy recid=7 stamp=525293003 filename=/oracle/oradata/aux1/tools01 .dbf datafile 9 switched to datafile copy input datafilecopy recid=8 stamp=525293003 filename=/oracle/oradata/aux1/users01 .dbf datafile 10 switched to datafile copy input datafilecopy recid=9 stamp=525293003 filename=/oracle/oradata/aux1/xdb01.d bf datafile 11 switched to datafile copy input datafilecopy recid=10 stamp=525293003 filename=/oracle/oradata/aux1/T_HEAL TH.dbf printing stored script: Memory Script { set until scn 17929284; recover clone database delete archivelog ; } executing script: Memory Script executing command: SET until clause Starting recover at 04-MAY-04 using channel ORA_AUX_DISK_1 starting media recovery archive log thread 1 sequence 55 is already on disk as file /oracle/product/920/ dbs/arch1_55.dbf archive log filename=/oracle/product/920/dbs/arch1_55.dbf thread=1 sequence=55 media recovery complete Finished recover at 04-MAY-04 printing stored script: Memory Script { shutdown clone; startup clone nomount pfile= '/oracle/product/920/dbs/initaux1.ora'; } executing script: Memory Script database dismounted Oracle instance shut down connected to auxiliary database (not started) Oracle instance started Total System Global Area 139954912 bytes Fixed Size 731872 bytes Variable Size 121634816 bytes Database Buffers 16777216 bytes Redo Buffers 811008 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "aux1" RESETLOGS ARCHIVELOG

MAXLOGFILES 50 MAXLOGMEMBERS 5 MAXDATAFILES 100 MAXINSTANCES 1 MAXLOGHISTORY 226 LOGFILE GROUP 1 ( '/oracle/oradata/aux1/redo01.log' ) SIZE 104857600 REUSE, GROUP 2 ( '/oracle/oradata/aux1/redo02.log' ) SIZE 104857600 REUSE, GROUP 3 ( '/oracle/oradata/aux1/redo03.log' ) SIZE 104857600 REUSE DATAFILE '/oracle/oradata/aux1/system01.dbf' CHARACTER SET AL32UTF8 printing stored script: Memory Script { catalog clone datafilecopy "/oracle/oradata/aux1/undotbs01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/cwmlite01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/drsys01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/example01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/indx01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/odm01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/tools01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/users01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/xdb01.dbf"; catalog clone datafilecopy "/oracle/oradata/aux1/T_HEALTH.dbf"; switch clone datafile all; } executing script: Memory Script cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/undotbs01.dbf recid=1 stamp=52529631 9 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/cwmlite01.dbf recid=2 stamp=52529631 9 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/drsys01.dbf recid=3 stamp=525296319 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/example01.dbf recid=4 stamp=52529631 9 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/indx01.dbf recid=5 stamp=525296319 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/odm01.dbf recid=6 stamp=525296319 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/tools01.dbf recid=7 stamp=525296319 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/users01.dbf recid=8 stamp=525296320 cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/xdb01.dbf recid=9 stamp=525296320

cataloged datafile copy datafile copy filename=/oracle/oradata/aux1/T_HEALTH.dbf recid=10 stamp=52529632 0 datafile 2 switched to datafile copy input datafilecopy recid=1 stamp=525296319 filename=/oracle/oradata/aux1/undotbs 01.dbf datafile 3 switched to datafile copy input datafilecopy recid=2 stamp=525296319 filename=/oracle/oradata/aux1/cwmlite 01.dbf datafile 4 switched to datafile copy input datafilecopy recid=3 stamp=525296319 filename=/oracle/oradata/aux1/drsys01 .dbf datafile 5 switched to datafile copy input datafilecopy recid=4 stamp=525296319 filename=/oracle/oradata/aux1/example 01.dbf datafile 6 switched to datafile copy input datafilecopy recid=5 stamp=525296319 filename=/oracle/oradata/aux1/indx01. dbf datafile 7 switched to datafile copy input datafilecopy recid=6 stamp=525296319 filename=/oracle/oradata/aux1/odm01.d bf datafile 8 switched to datafile copy input datafilecopy recid=7 stamp=525296319 filename=/oracle/oradata/aux1/tools01 .dbf datafile 9 switched to datafile copy input datafilecopy recid=8 stamp=525296320 filename=/oracle/oradata/aux1/users01 .dbf datafile 10 switched to datafile copy input datafilecopy recid=9 stamp=525296320 filename=/oracle/oradata/aux1/xdb01.d bf datafile 11 switched to datafile copy input datafilecopy recid=10 stamp=525296320 filename=/oracle/oradata/aux1/T_HEAL TH.dbf printing stored script: Memory Script { Alter clone database open resetlogs; } executing script: Memory Script database opened Finished Duplicate Db at 04-MAY-04 2nd Method Also, refer the below article from metalink !!! Note:186127.1 Subject: How to Create a Duplicate Database on Windows NT using RMAN

Potrebbero piacerti anche