测试一下active duplicate database,RMAN到底做了那些事情!
RMAN> duplicate target database to "joycedp" from active database nofilenamecheck;
Starting Duplicate Db at 12-JUL-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=21 device type=DISK
contents of Memory Script.:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script.:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 464519168 bytes
Fixed Size 1337240 bytes
Variable Size 289409128 bytes
Database Buffers 167772160 bytes
Redo Buffers 6000640 bytes
contents of Memory Script.:
{
sql clone "alter system set db_name =
''JOYCE'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''JOYCEDP'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u01/app/mengliu/oradata/joyce/control01.ctl';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''JOYCE'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''JOYCEDP'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 464519168 bytes
Fixed Size 1337240 bytes
Variable Size 289409128 bytes
Database Buffers 167772160 bytes
Redo Buffers 6000640 bytes
Starting backup at 12-JUL-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=32 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=40 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/mengliu/product/11.2.0/db_1/dbs/snapcf_joyce.f tag=TAG20120712T090334 RECID=7 STAMP=788432615
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 12-JUL-12
database mounted
contents of Memory Script.:
{
set newname for datafile 1 to
"/u01/app/mengliu/oradata/joyce/system01.dbf";
set newname for datafile 2 to
"/u01/app/mengliu/oradata/joyce/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/mengliu/oradata/joyce/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/mengliu/oradata/joyce/users01.dbf";
set newname for datafile 5 to
"/u01/app/mengliu/oradata/joyce/example01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u01/app/mengliu/oradata/joyce/system01.dbf" datafile
2 auxiliary format
"/u01/app/mengliu/oradata/joyce/sysaux01.dbf" datafile
3 auxiliary format
"/u01/app/mengliu/oradata/joyce/undotbs01.dbf" datafile
4 auxiliary format
"/u01/app/mengliu/oradata/joyce/users01.dbf" datafile
5 auxiliary format
"/u01/app/mengliu/oradata/joyce/example01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 12-JUL-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/mengliu/oradata/joyce/system01.dbf
channel ORA_DISK_2: starting datafile copy
input datafile file number=00002 name=/u01/app/mengliu/oradata/joyce/sysaux01.dbf
output file name=/u01/app/mengliu/oradata/joyce/system01.dbf tag=TAG20120712T090347
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:02:47
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/mengliu/oradata/joyce/example01.dbf
output file name=/u01/app/mengliu/oradata/joyce/sysaux01.dbf tag=TAG20120712T090347
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:02:47
channel ORA_DISK_2: starting datafile copy
input datafile file number=00003 name=/u01/app/mengliu/oradata/joyce/undotbs01.dbf
output file name=/u01/app/mengliu/oradata/joyce/example01.dbf tag=TAG20120712T090347
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/mengliu/oradata/joyce/users01.dbf
output file name=/u01/app/mengliu/oradata/joyce/undotbs01.dbf tag=TAG20120712T090347
channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:25
output file name=/u01/app/mengliu/oradata/joyce/users01.dbf tag=TAG20120712T090347
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 12-JUL-12
sql statement: alter system archive log current
contents of Memory Script.:
{
backup as copy reuse
archivelog like "/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf" auxiliary format
"/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf" ;
catalog clone archivelog "/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf";
switch clone datafile all;
}
executing Memory Script
Starting backup at 12-JUL-12
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=13 RECID=9 STAMP=788432822
output file name=/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 12-JUL-12
cataloged archived log
archived log file name=/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf RECID=9 STAMP=788432825
datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=788432826 file name=/u01/app/mengliu/oradata/joyce/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=788432826 file name=/u01/app/mengliu/oradata/joyce/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=788432826 file name=/u01/app/mengliu/oradata/joyce/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=788432826 file name=/u01/app/mengliu/oradata/joyce/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=788432826 file name=/u01/app/mengliu/oradata/joyce/example01.dbf
contents of Memory Script.:
{
set until scn 957952;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 12-JUL-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
allocated channel: ORA_AUX_DISK_2
channel ORA_AUX_DISK_2: SID=22 device type=DISK
starting media recovery
archived log for thread 1 with sequence 13 is already on disk as file /u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf
archived log file name=/u01/app/mengliu/archivelog/joyce/1_13_788081602.dbf thread=1 sequence=13
media recovery complete, elapsed time: 00:00:01
Finished recover at 12-JUL-12
contents of Memory Script.:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''JOYCEDP'' 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 464519168 bytes
Fixed Size 1337240 bytes
Variable Size 289409128 bytes
Database Buffers 167772160 bytes
Redo Buffers 6000640 bytes
sql statement: alter system set db_name = ''JOYCEDP'' 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 464519168 bytes
Fixed Size 1337240 bytes
Variable Size 289409128 bytes
Database Buffers 167772160 bytes
Redo Buffers 6000640 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "JOYCEDP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 SIZE 50 M ,
GROUP 2 SIZE 50 M ,
GROUP 3 SIZE 50 M
DATAFILE
'/u01/app/mengliu/oradata/joyce/system01.dbf'
CHARACTER SET AL32UTF8
contents of Memory Script.:
{
set newname for tempfile 1 to
"/u01/app/mengliu/oradata/joyce/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/mengliu/oradata/joyce/sysaux01.dbf",
"/u01/app/mengliu/oradata/joyce/undotbs01.dbf",
"/u01/app/mengliu/oradata/joyce/users01.dbf",
"/u01/app/mengliu/oradata/joyce/example01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/mengliu/oradata/joyce/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/app/mengliu/oradata/joyce/sysaux01.dbf RECID=1 STAMP=788432856
cataloged datafile copy
datafile copy file name=/u01/app/mengliu/oradata/joyce/undotbs01.dbf RECID=2 STAMP=788432856
cataloged datafile copy
datafile copy file name=/u01/app/mengliu/oradata/joyce/users01.dbf RECID=3 STAMP=788432856
cataloged datafile copy
datafile copy file name=/u01/app/mengliu/oradata/joyce/example01.dbf RECID=4 STAMP=788432856
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=788432856 file name=/u01/app/mengliu/oradata/joyce/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=788432856 file name=/u01/app/mengliu/oradata/joyce/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=788432856 file name=/u01/app/mengliu/oradata/joyce/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=788432856 file name=/u01/app/mengliu/oradata/joyce/example01.dbf
contents of Memory Script.:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 12-JUL-12
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25791987/viewspace-735344/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25791987/viewspace-735344/