Duplicate database – Chapter 8.2

 

RMAN> duplicate target database to DB3DUP
            spfile
            parameter_value_convert ‘/DB1/’,’/DB3DUP/’
            SET DB_CREATE_FILE_DEST ‘+BIG_DATA’
            set log_archive_dest_1=”;

Starting Duplicate Db at 25-FEB-13 08:48:32
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=760 device type=DISK

contents of Memory Script:
{
set until scn  1292640;
restore clone spfile to  ‘/u01/app/ora112/product/H11203/dbs/spfileDB3DUP.ora’;
sql clone “alter system set spfile= ”/u01/app/ora112/product/H11203/dbs/spfileDB3DUP.ora””;
}
executing Memory Script

executing command: SET until clause

Starting restore at 25-FEB-13 08:48:39
using channel ORA_AUX_DISK_1

WARNING: A restore time was estimated based on the supplied UNTIL SCN
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring SPFILE
output file name=/u01/app/ora112/product/H11203/dbs/spfileDB3DUP.ora
channel ORA_AUX_DISK_1: reading from backup piece +FRA/db1/autobackup/2013_02_24/s_808240145.395.808240145
channel ORA_AUX_DISK_1: piece handle=+FRA/db1/autobackup/2013_02_24/s_808240145.395.808240145 tag=TAG20130224T150905
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08
Finished restore at 25-FEB-13 08:48:48

sql statement: alter system set spfile= ”/u01/app/ora112/product/H11203/dbs/spfileDB3DUP.ora”

contents of Memory Script:
{
sql clone “alter system set  db_name =
”DB3DUP” comment=
”duplicate” scope=spfile”;
sql clone “alter system set  audit_file_dest =
”/u01/app/ora112/admin/DB3DUP/adump” comment=
”” scope=spfile”;
sql clone “alter system set  control_files =
”/u01/app/ora112/oradata/DB3DUP/control01.ctl” comment=
”Restore Controlfile” scope=spfile”;
sql clone “alter system set  DB_CREATE_FILE_DEST =
”+BIG_DATA” comment=
”” scope=spfile”;
sql clone “alter system set  log_archive_dest_1 =
”” comment=
”” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ”DB3DUP” comment= ”duplicate” scope=spfile

sql statement: alter system set  audit_file_dest =  ”/u01/app/ora112/admin/DB3DUP/adump” comment= ”” scope=spfile

sql statement: alter system set  control_files =  ”/u01/app/ora112/oradata/DB3DUP/control01.ctl” comment= ”Restore Controlfile” scope=spfile

sql statement: alter system set  DB_CREATE_FILE_DEST =  ”+BIG_DATA” comment= ”” scope=spfile

sql statement: alter system set  log_archive_dest_1 =  ”” comment= ”” scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

contents of Memory Script:
{
sql clone “alter system set  db_name =
”DB1” comment=
”Modified by RMAN duplicate” scope=spfile”;
sql clone “alter system set  db_unique_name =
”DB3DUP” comment=
”Modified by RMAN duplicate” scope=spfile”;
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile;
alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ”DB1” comment= ”Modified by RMAN duplicate” scope=spfile

sql statement: alter system set  db_unique_name =  ”DB3DUP” comment= ”Modified by RMAN duplicate” scope=spfile

Oracle instance shut down

Oracle instance started
Starting restore at 25-FEB-13 08:50:14
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=193 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece +FRA/db1/autobackup/2013_02_24/s_808240145.395.808240145
channel ORA_AUX_DISK_1: piece handle=+FRA/db1/autobackup/2013_02_24/s_808240145.395.808240145 tag=TAG20130224T150905
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:10
output file name=/u01/app/ora112/oradata/DB3DUP/control01.ctl
Finished restore at 25-FEB-13 08:50:27

database mounted

contents of Memory Script:
{
set until scn  1292640;
set newname for clone datafile  1 to new;
set newname for clone datafile  2 to new;
set newname for clone datafile  3 to new;
restore
clone database
;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-FEB-13 08:50:34
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +BIG_DATA
channel ORA_AUX_DISK_1: restoring datafile 00002 to +BIG_DATA
channel ORA_AUX_DISK_1: restoring datafile 00003 to +BIG_DATA
channel ORA_AUX_DISK_1: reading from backup piece +FRA/db1/backupset/2013_02_24/nnndf0_tag20130224t150657_0.390.808240023
channel ORA_AUX_DISK_1: piece handle=+FRA/db1/backupset/2013_02_24/nnndf0_tag20130224t150657_0.390.808240023 tag=TAG20130224T150657
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:45
Finished restore at 25-FEB-13 08:52:20

contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=12 STAMP=808303941 file name=+BIG_DATA/db3dup/datafile/system.257.808303837
datafile 2 switched to datafile copy
input datafile copy RECID=13 STAMP=808303941 file name=+BIG_DATA/db3dup/datafile/sysaux.265.808303839
datafile 3 switched to datafile copy
input datafile copy RECID=14 STAMP=808303941 file name=+BIG_DATA/db3dup/datafile/undotbs1.278.808303841

contents of Memory Script:
{
set until scn  1292640;
recover
clone database
delete archivelog
;
}
executing Memory Script

executing command: SET until clause

Starting recover at 25-FEB-13 08:52:21
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 47 is already on disk as file +FRA/db1/archivelog/2013_02_25/thread_1_seq_47.403.808302329
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=46
channel ORA_AUX_DISK_1: reading from backup piece +FRA/db1/backupset/2013_02_24/annnf0_tag20130224t150854_0.402.808240139
channel ORA_AUX_DISK_1: piece handle=+FRA/db1/backupset/2013_02_24/annnf0_tag20130224t150854_0.402.808240139 tag=TAG20130224T150854
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=+FRA/db3dup/archivelog/2013_02_25/thread_1_seq_46.431.808303973 thread=1 sequence=46
channel clone_default: deleting archived log(s)
archived log file name=+FRA/db3dup/archivelog/2013_02_25/thread_1_seq_46.431.808303973 RECID=38 STAMP=808303975
archived log file name=+FRA/db1/archivelog/2013_02_25/thread_1_seq_47.403.808302329 thread=1 sequence=47
media recovery complete, elapsed time: 00:00:14
Finished recover at 25-FEB-13 08:53:10
Oracle instance started

{
sql clone “alter system set  db_name =
”DB3DUP” comment=
”Reset to original value by RMAN” scope=spfile”;
sql clone “alter system reset  db_unique_name scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ”DB3DUP” comment= ”Reset to original value by RMAN” scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3541934080 bytes

Fixed Size                     2164392 bytes
Variable Size               2483034456 bytes
Database Buffers            1040187392 bytes
Redo Buffers                  16547840 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE “DB3DUP” RESETLOGS ARCHIVELOG
MAXLOGFILES      5
MAXLOGMEMBERS      5
MAXDATAFILES      100
MAXINSTANCES     1
MAXLOGHISTORY      292
LOGFILE
GROUP   1  SIZE 100 M ,
GROUP   2  SIZE 100 M ,
GROUP   3  SIZE 100 M
DATAFILE
‘+BIG_DATA/db3dup/datafile/system.257.808303837’
CHARACTER SET UTF8

contents of Memory Script:
{
set newname for clone tempfile  1 to new;
switch clone tempfile all;
catalog clone datafilecopy  “+BIG_DATA/db3dup/datafile/sysaux.265.808303839”,
“+BIG_DATA/db3dup/datafile/undotbs1.278.808303841”;
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +BIG_DATA in control file

cataloged datafile copy
datafile copy file name=+BIG_DATA/db3dup/datafile/sysaux.265.808303839 RECID=1 STAMP=808304080
cataloged datafile copy
datafile copy file name=+BIG_DATA/db3dup/datafile/undotbs1.278.808303841 RECID=2 STAMP=808304080

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=808304080 file name=+BIG_DATA/db3dup/datafile/sysaux.265.808303839
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=808304080 file name=+BIG_DATA/db3dup/datafile/undotbs1.278.808303841

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 25-FEB-13 08:55:23

Leave a Reply

Your email address will not be published. Required fields are marked *