Visit Counter

Sunday, November 17, 2013

Duplicate Database Using RMAN



$ rman target sys/pwd@orasoft nocatalog auxiliary /

Recovery Manager: Release 10.2.0.2.0 - Production on Thu 01 Apr 14:35:00 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: ORASOFT (DBID=3746996829)
using target database control file instead of recovery catalog
connected to auxiliary database: ORADUP (not mounted)

RMAN> duplicate target database to oradup
2> pfile='/home/oracle/oracle/product/10.2.0/db_2/dbs/initdup.ora';

Starting Duplicate Db at 01-APR-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
contents of Memory Script:

{

set until scn 796992;
set newname for datafile 1 to
"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/system01.dbf";
set newname for datafile 2 to
"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf";
set newname for datafile 3 to
"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf";
set newname for datafile 4 to
"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf";
set newname for datafile 5 to
"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.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
executing command: SET NEWNAME

Starting restore at 01-APR-10
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/system01.dbf
restoring datafile 00002 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf
restoring datafile 00003 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf
restoring datafile 00004 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf
restoring datafile 00005 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/flash_recovery_area/ORASOFT/backupset/2010-04-
01/o1_mf_nnndf_TAG20120522T131351_7vpsq0ls_.bkp
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/home/oracle/flash_recovery_area/ORASOFT/backupset/2010_04_01/o1_mf_nnndf_TAG2010522T131351_7vpsq0ls_.bkp tag=TAG20100401T131351
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:36

Finished restore at 01-APR-10

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORADUP" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292

LOGFILE
GROUP 1 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo01.log' ) SIZE 50 M REUSE,

GROUP 2 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo02.log' ) SIZE 50 M REUSE,

GROUP 3 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo03.log' ) SIZE 50 M REUSE

DATAFILE

'/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/system01.dbf'
CHARACTER SET WE8ISO8859P1

contents of Memory Script:

{

switch clone datafile all;

}

executing Memory Script

released channel: ORA_AUX_DISK_1

datafile 2 switched to datafile copy

input datafile copy recid=1 stamp=783959863 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf

datafile 3 switched to datafile copy

input datafile copy recid=2 stamp=783959863 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy recid=3 stamp=783959863 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf

datafile 5 switched to datafile copy

input datafile copy recid=4 stamp=783959863 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.dbf



contents of Memory Script:

{

set until scn 796992;

recover

clone database

delete archivelog

;

}

executing Memory Script

executing command: SET until clause

Starting recover at 01-APR-10

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=159 devtype=DISK

starting media recovery

archive log thread 1 sequence 3 is already on disk as file /home/oracle/archiev1/1_3_783781354.dbf

archive log filename=/home/oracle/archiev1/1_3_783781354.dbf thread=1 sequence=3

media recovery complete, elapsed time: 00:00:01

Finished recover at 01-APR-10

contents of Memory Script:

{

shutdown clone;

startup clone nomount pfile= '/home/oracle/oracle/product/10.2.0/db_2/dbs/initdup.ora';

}

executing Memory Script

database dismounted

Oracle instance shut down

connected to auxiliary database (not started)

Oracle instance started

Total System Global Area 608174080 bytes

Fixed Size 1281624 bytes

Variable Size 163578280 bytes

Database Buffers 436207616 bytes

Redo Buffers 7106560 bytes

sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORADUP" RESETLOGS ARCHIVELOG

MAXLOGFILES 16

MAXLOGMEMBERS 3

MAXDATAFILES 100

MAXINSTANCES 8

MAXLOGHISTORY 292

LOGFILE

GROUP 1 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo01.log' ) SIZE 50 M REUSE,

GROUP 2 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo02.log' ) SIZE 50 M REUSE,

GROUP 3 ( '//home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/redo03.log' ) SIZE 50 M REUSE

DATAFILE

'/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/system01.dbf'

CHARACTER SET WE8ISO8859P1

contents of Memory Script:

{

set newname for tempfile 1 to

"/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/temp01.dbf";

switch clone tempfile all;

catalog clone datafilecopy "/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf";

catalog clone datafilecopy "/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf";

catalog clone datafilecopy "/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf";

catalog clone datafilecopy "/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.dbf";

switch clone datafile all;

}

executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to /home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/temp01.dbf in control file

cataloged datafile copy

datafile copy filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf recid=1 stamp=783959877

cataloged datafile copy

datafile copy filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf recid=2 stamp=783959877

cataloged datafile copy

datafile copy filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf recid=3 stamp=783959877

cataloged datafile copy

datafile copy filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.dbf recid=4 stamp=783959877

datafile 2 switched to datafile copy

input datafile copy recid=1 stamp=783959877 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/undotbs01.dbf

datafile 3 switched to datafile copy

input datafile copy recid=2 stamp=783959877 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy recid=3 stamp=783959877 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/users01.dbf

datafile 5 switched to datafile copy

input datafile copy recid=4 stamp=783959877 filename=/home/oracle/oracle/product/10.2.0/db_2/oradata/oradup/example01.dbf


contents of Memory Script:

{

Alter clone database open resetlogs;

}

executing Memory Script

database opened

Finished Duplicate Db at 01-APR-10

RMAN>


No comments:

Post a Comment