duplicate数据库 过程观察

教程发布:风哥 教程分类:ITPUX技术网 更新日期:2022-02-12 浏览学习:53

RMAN> duplicate target database to aux;

Starting Duplicate Db at 2014-07-13 21:05:00
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

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 217157632 bytes

Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes

contents of Memory Script:
{
sql clone "alter system set db_name =
''TEST'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''AUX'' 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 = ''TEST'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set db_unique_name = ''AUX'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 217157632 bytes

Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes

Starting restore at 2014-07-13 21:05:07
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 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 /u01/app/oracle/flash_recovery_area/TEST/autobackup/2014_07_13/o1_mf_s_852840979_9w4y4mhy_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/TEST/autobackup/2014_07_13/o1_mf_s_852840979_9w4y4mhy_.bkp tag=TAG20140713T201619
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/cntrlaux.dbf
Finished restore at 2014-07-13 21:05:08

database mounted

contents of Memory Script:
{
set until scn 2018786;
sql clone 'alter database flashback off';
set newname for datafile 1 to
"/u01/app/oracle/oradata/aux/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/aux/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/aux/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/aux/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/aux/example01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf";
restore
clone database
;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database flashback off

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 2014-07-13 21:05:15
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 /u01/app/oracle/oradata/aux/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/aux/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/aux/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/aux/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/aux/example01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2014_07_13/o1_mf_nnndf_TAG20140713T201603_9w4y435w_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2014_07_13/o1_mf_nnndf_TAG20140713T201603_9w4y435w_.bkp tag=TAG20140713T201603
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:45
Finished restore at 2014-07-13 21:07:00

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

datafile 1 switched to datafile copy
input datafile copy RECID=7 STAMP=852844020 file name=/u01/app/oracle/oradata/aux/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=8 STAMP=852844021 file name=/u01/app/oracle/oradata/aux/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=9 STAMP=852844021 file name=/u01/app/oracle/oradata/aux/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=10 STAMP=852844021 file name=/u01/app/oracle/oradata/aux/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=11 STAMP=852844022 file name=/u01/app/oracle/oradata/aux/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=12 STAMP=852844022 file name=/u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf

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

executing command: SET until clause

Starting recover at 2014-07-13 21:07:04
using channel ORA_AUX_DISK_1

starting media recovery

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=18
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/TEST/backupset/2014_07_13/o1_mf_annnn_TAG20140713T201618_9w4y4lc5_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/TEST/backupset/2014_07_13/o1_mf_annnn_TAG20140713T201618_9w4y4lc5_.bkp tag=TAG20140713T201618
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_18_852578633.dbf thread=1 sequence=18
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_18_852578633.dbf RECID=29 STAMP=852844026
media recovery complete, elapsed time: 00:00:02
Finished recover at 2014-07-13 21:07:09

contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''AUX'' 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 217157632 bytes

Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes

sql statement: alter system set db_name = ''AUX'' 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 217157632 bytes

Fixed Size 2211928 bytes
Variable Size 159387560 bytes
Database Buffers 50331648 bytes
Redo Buffers 5226496 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/aux/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/aux/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/aux/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/aux/system01.dbf'
CHARACTER SET WE8MSWIN1252

contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/aux/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/aux/sysaux01.dbf",
"/u01/app/oracle/oradata/aux/undotbs01.dbf",
"/u01/app/oracle/oradata/aux/users01.dbf",
"/u01/app/oracle/oradata/aux/example01.dbf",
"/u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/aux/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/aux/sysaux01.dbf RECID=1 STAMP=852844042
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/aux/undotbs01.dbf RECID=2 STAMP=852844042
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/aux/users01.dbf RECID=3 STAMP=852844042
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/aux/example01.dbf RECID=4 STAMP=852844042
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf RECID=5 STAMP=852844042

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=852844042 file name=/u01/app/oracle/oradata/aux/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=852844042 file name=/u01/app/oracle/oradata/aux/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=852844042 file name=/u01/app/oracle/oradata/aux/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=852844042 file name=/u01/app/oracle/oradata/aux/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=852844042 file name=/u01/app/oracle/oradata/AUX/datafile/o1_mf_tbs_1_9vqskqk4_.dbf

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

database opened
Finished Duplicate Db at 2014-07-13 21:07:52

本文标签:
网站声明:本文由风哥整理发布,转载请保留此段声明,本站所有内容将不对其使用后果做任何承诺,请读者谨慎使用!
【上一篇】
【下一篇】