RMAN> DUPLICATE TARGET DATABASE TO dhstg FROM ACTIVE DATABASE
2> spfile
3> parameter_value_convert
4> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
5> set db_file_name_convert
6> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
7> set log_file_name_convert
8> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
9> nofilenamecheck;
Starting Duplicate Db at 06-APR-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=63 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile ‘/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora’ auxiliary format
‘/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora’ ;
sql clone “alter system set spfile= ”/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora””;
}
executing Memory Script
Starting backup at 06-APR-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
Finished backup at 06-APR-15
sql statement: alter system set spfile= ”/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora”
contents of Memory Script:
{
sql clone “alter system set db_name =
”DHSTG” comment=
”duplicate” scope=spfile”;
sql clone “alter system set control_files =
”/data1/diff/dhstg/control01.ctl”, ”/data1/diff/dhstg/control02.ctl” comment=
”” scope=spfile”;
sql clone “alter system set db_file_name_convert =
”/data1/dhstg”, ”/data1/diff/dhstg” comment=
”” scope=spfile”;
sql clone “alter system set log_file_name_convert =
”/data1/dhstg”, ”/data1/diff/dhstg” comment=
”” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ”DHSTG” comment= ”duplicate” scope=spfile
sql statement: alter system set control_files = ”/data1/diff/dhstg/control01.ctl”, ”/data1/diff/dhstg/control02.ctl” comment= ”” scope=spfile
sql statement: alter system set db_file_name_convert = ”/data1/dhstg”, ”/data1/diff/dhstg” comment= ”” scope=spfile
sql statement: alter system set log_file_name_convert = ”/data1/dhstg”, ”/data1/diff/dhstg” comment= ”” scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
contents of Memory Script:
{
sql clone “alter system set db_name =
”DHSTG” comment=
”Modified by RMAN duplicate” scope=spfile”;
sql clone “alter system set db_unique_name =
”DHSTG” comment=
”Modified by RMAN duplicate” scope=spfile”;
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format ‘/data1/diff/dhstg/control01.ctl’;
restore clone controlfile to ‘/data1/diff/dhstg/control02.ctl’ from
‘/data1/diff/dhstg/control01.ctl’;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ”DHSTG” comment= ”Modified by RMAN duplicate” scope=spfile
sql statement: alter system set db_unique_name = ”DHSTG” comment= ”Modified by RMAN duplicate” scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
Starting backup at 06-APR-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/data2/app/oracle/product/11.2.0/dbs/snapcf_dhstg.f tag=TAG20150406T125217 RECID=2 STAMP=876315139
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 06-APR-15
Starting restore at 06-APR-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=63 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 06-APR-15
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
“/data1/diff/dhstg/system01.dbf”;
set newname for datafile 2 to
“/data1/diff/dhstg/sysaux01.dbf”;
set newname for datafile 3 to
“/data1/diff/dhstg/undotbs01.dbf”;
set newname for datafile 4 to
“/data1/diff/dhstg/users01.dbf”;
set newname for datafile 5 to
“/data1/diff/dhstg/example01.dbf”;
set newname for datafile 6 to
“/data1/diff/dhstg/data01.dbf”;
backup as copy reuse
datafile 1 auxiliary format
“/data1/diff/dhstg/system01.dbf” datafile
2 auxiliary format
“/data1/diff/dhstg/sysaux01.dbf” datafile
3 auxiliary format
“/data1/diff/dhstg/undotbs01.dbf” datafile
4 auxiliary format
“/data1/diff/dhstg/users01.dbf” datafile
5 auxiliary format
“/data1/diff/dhstg/example01.dbf” datafile
6 auxiliary format
“/data1/diff/dhstg/data01.dbf” ;
}
executing Memory Script
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 backup at 06-APR-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/data1/dhstg/system01.dbf
output file name=/data1/diff/dhstg/system01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/data1/dhstg/sysaux01.dbf
output file name=/data1/diff/dhstg/sysaux01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/data1/dhstg/undotbs01.dbf
output file name=/data1/diff/dhstg/undotbs01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/data1/dhstg/data01.dbf
output file name=/data1/diff/dhstg/data01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/data1/dhstg/example01.dbf
output file name=/data1/diff/dhstg/example01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/data1/dhstg/users01.dbf
output file name=/data1/diff/dhstg/users01.dbf tag=TAG20150406T125229
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 06-APR-15
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=876315893 file name=/data1/diff/dhstg/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=876315894 file name=/data1/diff/dhstg/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=876315894 file name=/data1/diff/dhstg/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=876315894 file name=/data1/diff/dhstg/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=876315895 file name=/data1/diff/dhstg/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=7 STAMP=876315895 file name=/data1/diff/dhstg/data01.dbf
contents of Memory Script:
{
recover
clone database
noredo
delete archivelog
;
}
executing Memory Script
Starting recover at 06-APR-15
using channel ORA_AUX_DISK_1
Finished recover at 06-APR-15
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone “alter system set db_name =
”DHSTG” 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
database dismounted
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
sql statement: alter system set db_name = ”DHSTG” 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 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE “DHSTG” RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( ‘/data1/diff/dhstg/redo01.log’ ) SIZE 50 M REUSE,
GROUP 2 ( ‘/data1/diff/dhstg/redo02.log’ ) SIZE 50 M REUSE,
GROUP 3 ( ‘/data1/diff/dhstg/redo03.log’ ) SIZE 50 M REUSE
DATAFILE
‘/data1/diff/dhstg/system01.dbf’
CHARACTER SET AL32UTF8
contents of Memory Script:
{
set newname for tempfile 1 to
“/data1/diff/dhstg/temp01.dbf”;
switch clone tempfile all;
catalog clone datafilecopy “/data1/diff/dhstg/sysaux01.dbf”,
“/data1/diff/dhstg/undotbs01.dbf”,
“/data1/diff/dhstg/users01.dbf”,
“/data1/diff/dhstg/example01.dbf”,
“/data1/diff/dhstg/data01.dbf”;
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /data1/diff/dhstg/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/data1/diff/dhstg/sysaux01.dbf RECID=1 STAMP=876315921
cataloged datafile copy
datafile copy file name=/data1/diff/dhstg/undotbs01.dbf RECID=2 STAMP=876315921
cataloged datafile copy
datafile copy file name=/data1/diff/dhstg/users01.dbf RECID=3 STAMP=876315922
cataloged datafile copy
datafile copy file name=/data1/diff/dhstg/example01.dbf RECID=4 STAMP=876315922
cataloged datafile copy
datafile copy file name=/data1/diff/dhstg/data01.dbf RECID=5 STAMP=876315922
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=876315921 file name=/data1/diff/dhstg/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=876315921 file name=/data1/diff/dhstg/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=876315922 file name=/data1/diff/dhstg/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=876315922 file name=/data1/diff/dhstg/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=876315922 file name=/data1/diff/dhstg/data01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 06-APR-15