Use RMAN's DUPLICATE to clone the output of Oracle10gR2 Database
Clone the output of the Oracle 10g R2 database using RMAN DUPLICATE
Clone the output of the Oracle 10g R2 database using RMAN DUPLICATE
[Date: 2012-02-03] Source: Linux Author: andylhz2009 [Font:]
The output of this command shows that the duplicate command of Oracle RMAN is executed internally and has a deeper understanding of cloning.
For demonstration of the previous steps, see:
C: \ oracle \ product \ 10.2.0 \ client_1 \ BIN> rman target sys/password @ DGP
Recovery MANAGER: Release 10.2.0.1.0-Production on Tuesday January 31 00:59:06 2012
Copyright (c) 1982,200 5, Oracle. All rights reserved.
Connect to the target database: DG (DBID = 1686618574)
RMAN> connect auxiliary sys/password @ DGS
Connected to secondary Database: DGC (not loaded)
RMAN> duplicate target database to dgc;
Start Duplicate Db from month 1 to Month 12
Use the target database control file to replace the recovery directory
Allocated channel: ORA_AUX_DISK_1
Channel ORA_AUX_DISK_1: sid = 155 devtype = DISK
Memory script content:
{
Set until scn 526998;
Set newname for datafile 1
"/U01/app/oracle/oradata/dgc/system01.dbf ";
Set newname for datafile 2
"/U01/app/oracle/oradata/dgc/undotbs01.dbf ";
Set newname for datafile 3
"/U01/app/oracle/oradata/dgc/sysaux01.dbf ";
Set newname for datafile 4
"/U01/app/oracle/oradata/dgc/users01.dbf ";
Restore
Check readonly
Clone database
;
}
Executing memory script
Executing command: SET until clause
Executing command: SET NEWNAME
Executing command: SET NEWNAME
Executing command: SET NEWNAME
Executing command: SET NEWNAME
Start restore from month 1 to Month 12
Use channel ORA_AUX_DISK_1
Channel ORA_AUX_DISK_1: recovering the data file backup set
Channel ORA_AUX_DISK_1: Specifies the data file to be recovered from the backup set.
Restoring data file 00001 to/u01/app/oracle/oradata/dgc/system01.dbf
Restoring data file 00002 to/u01/app/oracle/oradata/dgc/undotbs01.dbf
Restoring data file 00003 to/u01/app/oracle/oradata/dgc/sysaux01.dbf
Restoring data file 00004 to/u01/app/oracle/oradata/dgc/users01.dbf
Channel ORA_AUX_DISK_1: Reading the backup segment/home/oracle/all_DG_2.bak
Channel ORA_AUX_DISK_1: recovered backup segment 1
Segment handle =/home/oracle/all_DG_2.bak mark = TAG20120125T110557
Channel ORA_AUX_DISK_1: Recovery completed, time: 00:00:54
The restore is completed from month 1 to Month 12.
SQL statement: CREATE CONTROLFILE REUSE SET DATABASE "DGC" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
# MAXLOGHISTORY 292
LOGFILE
GROUP 1 ('/u01/app/oracle/oradata/dgc/redo01.log') SIZE 50 m reuse,
GROUP 2 ('/u01/app/oracle/oradata/dgc/redo02.log') SIZE 50 m reuse,
GROUP 3 ('/u01/app/oracle/oradata/dgc/redo03.log') SIZE 50 M REUSE
DATAFILE
'/U01/app/oracle/oradata/dgc/system01.dbf'
Character set ZHS16GBK
Memory script content:
{
Switch clone datafile all;
}
Executing memory script
Released channel: ORA_AUX_DISK_1
Data File 2 has been converted to a data file copy
Input data file copy recid = 1 stamp = 773487060 file name =/u01/app/oracle/oradata/dgc/undo
Tbs01.dbf
Data File 3 has been converted to a data file copy
Input data file copy recid = 2 stamp = 773487060 file name =/u01/app/oracle/oradata/dgc/sysa
Ux01.dbf
Data File 4 has been converted to a data file copy
Input data file copy recid = 3 stamp = 773487060 file name =/u01/app/oracle/oradata/dgc/user
S01.dbf
Memory script content:
{
Set until scn 526998;
Recover
Clone database
Delete archivelog
;
}
Executing memory script
Executing command: SET until clause
Start recover from month 1 to Month 12
Allocated channel: ORA_AUX_DISK_1
Channel ORA_AUX_DISK_1: sid = 155 devtype = DISK
Restoring media...
Archived log thread 1 sequence 14 is used as a file/u01/app/oracle/flash_recovery_area/DGP/archiv
Elog/2012_01_25/o1_mf_1_14_7kywg5q6 _. arc exists on the disk
Archived log file name =/u01/app/oracle/flash_recovery_area/DGP/archivelog/2012_01_25/o1
_ Mf_1_14_7kywg5q6 _. arc thread = 1 sequence = 14
Media Recovery completed. Time: 00:00:01
The recover is completed from month 1 to Month 12.