Tuesday, June 24, 2008

RMAN Duplicate Database



RMAN duplicate standby
I think this is the good one, I will check into it to see if I have a better one, so for now enjoy, it might be of great help.

The correct backup of primary database have been performed using

RMAN> configure channel device type disk format '/u03/rman/bkup/rmanbk_%d%s%t';

new RMAN configuration parameters:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/rman/bkup/rmanbk_%d%s%t';

new RMAN configuration parameters are successfully stored

starting full resync of recovery catalog

full resync complete

RMAN> configure device type disk parallelism 2;

new RMAN configuration parameters:

CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;

new RMAN configuration parameters are successfully stored

starting full resync of recovery catalog

full resync complete

RMAN> backup database include current controlfile for standby archivelog all;


SQL> startup nomount

ORACLE instance started.

Total System Global Area 1.5032E+10 bytes

Fixed Size 2203608 bytes

Variable Size 2006736936 bytes

Database Buffers 1.3019E+10 bytes

Redo Buffers 4325376 bytes

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition
RMAN duplicate standby

The correct backup of primary database have been performed using

RMAN> configure channel device type disk format '/u03/rman/bkup/rmanbk_%d%s%t';

new RMAN configuration parameters:

CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u03/rman/bkup/rmanbk_%d%s%t';

new RMAN configuration parameters are successfully stored

starting full resync of recovery catalog

full resync complete

RMAN> configure device type disk parallelism 2;

new RMAN configuration parameters:

CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO BACKUPSET;

new RMAN configuration parameters are successfully stored

starting full resync of recovery catalog

full resync complete

RMAN> backup database include current controlfile for standby archivelog all;


SQL> startup nomount

ORACLE instance started.

Total System Global Area 1.5032E+10 bytes

Fixed Size 2203608 bytes

Variable Size 2006736936 bytes

Database Buffers 1.3019E+10 bytes

Redo Buffers 4325376 bytes

SQL> exit

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

[oracle@testbox /u03/rman/bkup]$ rman auxiliary / target sys@test1

Recovery Manager: Release 10.2.0.3.0 - Production on Tue Nov 20 11:52:29 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

target database Password:

connected to target database: TEST1 (DBID=4550100)

connected to auxiliary database: TEST1 (not mounted)

RMAN> duplicate target database for standby nofilenamecheck dorecover;

Starting Duplicate Db at 20-NOV-07

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=169 devtype=DISK

allocated channel: ORA_AUX_DISK_2

channel ORA_AUX_DISK_2: sid=45 devtype=DISK

contents of Memory Script:

{

set until scn 1232983;

restore clone standby controlfile;

sql clone 'alter database mount standby database';

}

executing Memory Script

executing command: SET until clause

Starting restore at 20-NOV-07

using channel ORA_AUX_DISK_1

using channel ORA_AUX_DISK_2

channel ORA_AUX_DISK_1: restoring control file

ORA-19600: input file is control file (/u01/standby.ctl)
ORA-19601: output file is control file (/u01/oradata/test2/control01.ctl)
failover to previous backup

channel ORA_AUX_DISK_1: starting datafile backupset restore

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: reading from backup piece /u03/rman/bkup/rmanbk_TEST14638548937

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/u03/rman/bkup/rmanbk_TEST14638548937 tag=TAG20071113Txxxx

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

output filename=/u01/oradata/test2/control01.ctl

output filename=/u02/oradata/test2/control02.ctl

output filename=/u03/oradata/test2/control03.ctl

Finished restore at 20-NOV-07

sql statement: alter database mount standby database

released channel: ORA_AUX_DISK_1

released channel: ORA_AUX_DISK_2

contents of Memory Script:

{

set until scn 1232983;

set newname for tempfile 1 to

"/u01/oradata/test1/temp01.dbf";

switch clone tempfile all;

set newname for datafile 1 to

"/u03/oradata/test1/system01.dbf";

set newname for datafile 2 to

"/u04/oradata/test1/undotbs01.dbf";

set newname for datafile 3 to

"/u03/oradata/test1/sysaux01.dbf";

set newname for datafile 4 to

"/u01/oradata/test1/users01.dbf";

set newname for datafile 5 to

"/u03/oradata/test1/rman_tbs.dbf";

restore

check readonly

clone database

;

}

executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

renamed temporary file 1 to /u01/oradata/test1/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20-NOV-07

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=45 devtype=DISK

allocated channel: ORA_AUX_DISK_2

channel ORA_AUX_DISK_2: sid=104 devtype=DISK

skipping datafile 4; already restored to file /u01/oradata/test1/users01.dbf

skipping datafile 5; already restored to file /u03/oradata/test1/rman_tbs.dbf

skipping datafile 1; already restored to file /u03/oradata/test1/system01.dbf

skipping datafile 2; already restored to file /u04/oradata/test1/undotbs01.dbf

skipping datafile 3; already restored to file /u03/oradata/test1/sysaux01.dbf

restore not done; all files readonly, offline, or already restored

Finished restore at 20-NOV-07

contents of Memory Script:

{

switch clone datafile all;

}

executing Memory Script

datafile 1 switched to datafile copy

input datafile copy recid=1 stamp=639143579 filename=/u03/oradata/test1/system01.dbf

datafile 2 switched to datafile copy

input datafile copy recid=2 stamp=639143579 filename=/u04/oradata/test1/undotbs01.dbf

datafile 3 switched to datafile copy

input datafile copy recid=3 stamp=639143580 filename=/u03/oradata/test1/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy recid=4 stamp=639143580 filename=/u01/oradata/test1/users01.dbf

datafile 5 switched to datafile copy

input datafile copy recid=5 stamp=639143580 filename=/u03/oradata/test1/rman_tbs.dbf

contents of Memory Script:

{

set until scn 1232983;

recover

standby

clone database

delete archivelog

;

}

executing Memory Script

executing command: SET until clause

Starting recover at 20-NOV-07

using channel ORA_AUX_DISK_1

using channel ORA_AUX_DISK_2

starting media recovery

archive log thread 1 sequence 36 is already on disk as file /u04/arch1/test1/1_36_637945588.arc

archive log thread 1 sequence 37 is already on disk as file /u04/arch1/test1/1_37_637945588.arc

archive log thread 1 sequence 38 is already on disk as file /u04/arch1/test1/1_38_637945588.arc

archive log filename=/u04/arch1/test1/1_36_637945588.arc thread=1 sequence=36

archive log filename=/u04/arch1/test1/1_37_637945588.arc thread=1 sequence=37

archive log filename=/u04/arch1/test1/1_38_637945588.arc thread=1 sequence=38

channel ORA_AUX_DISK_1: starting archive log restore to default destination

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=39

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=40

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=41

channel ORA_AUX_DISK_1: reading from backup piece /u03/rman/bkup/rmanbk_TEST111639142479

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/u03/rman/bkup/rmanbk_TEST111639142479 tag=TAG20071120T113439

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_39_637945588.arc thread=1 sequence=39

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_39_637945588.arc recid=1 stamp=639143604

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_40_637945588.arc thread=1 sequence=40

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_40_637945588.arc recid=3 stamp=639143607

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_41_637945588.arc thread=1 sequence=41

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_41_637945588.arc recid=2 stamp=639143606

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

Finished recover at 20-NOV-07

Finished Duplicate Db at 20-NOV-07

RMAN>

Release 10.2.0.3.0 - 64bit Production

With the Partitioning, OLAP and Data Mining options

[oracle@testbox /u03/rman/bkup]$ rman auxiliary / target sys@test1

Recovery Manager: Release 10.2.0.3.0 - Production on Tue Nov 20 11:52:29 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

target database Password:

connected to target database: TEST1 (DBID=4550100)

connected to auxiliary database: TEST1 (not mounted)

RMAN> duplicate target database for standby nofilenamecheck dorecover;

Starting Duplicate Db at 20-NOV-07

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=169 devtype=DISK

allocated channel: ORA_AUX_DISK_2

channel ORA_AUX_DISK_2: sid=45 devtype=DISK

contents of Memory Script:

{

set until scn 1232983;

restore clone standby controlfile;

sql clone 'alter database mount standby database';

}

executing Memory Script

executing command: SET until clause

Starting restore at 20-NOV-07

using channel ORA_AUX_DISK_1

using channel ORA_AUX_DISK_2

channel ORA_AUX_DISK_1: restoring control file

ORA-19600: input file is control file (/u01/standby.ctl)
ORA-19601: output file is control file (/u01/oradata/test2/control01.ctl)
failover to previous backup

channel ORA_AUX_DISK_1: starting datafile backupset restore

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: reading from backup piece /u03/rman/bkup/rmanbk_TEST14638548937

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/u03/rman/bkup/rmanbk_TEST14638548937 tag=TAG20071113xxxxx

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01

output filename=/u01/oradata/test2/control01.ctl

output filename=/u02/oradata/test2/control02.ctl

output filename=/u03/oradata/test2/control03.ctl

Finished restore at 20-NOV-07

sql statement: alter database mount standby database

released channel: ORA_AUX_DISK_1

released channel: ORA_AUX_DISK_2

contents of Memory Script:

{

set until scn 1232983;

set newname for tempfile 1 to

"/u01/oradata/test1/temp01.dbf";

switch clone tempfile all;

set newname for datafile 1 to

"/u03/oradata/test1/system01.dbf";

set newname for datafile 2 to

"/u04/oradata/test1/undotbs01.dbf";

set newname for datafile 3 to

"/u03/oradata/test1/sysaux01.dbf";

set newname for datafile 4 to

"/u01/oradata/test1/users01.dbf";

set newname for datafile 5 to

"/u03/oradata/test1/rman_tbs.dbf";

restore

check readonly

clone database

;

}

executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

renamed temporary file 1 to /u01/oradata/test1/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 20-NOV-07

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: sid=45 devtype=DISK

allocated channel: ORA_AUX_DISK_2

channel ORA_AUX_DISK_2: sid=104 devtype=DISK

skipping datafile 4; already restored to file /u01/oradata/test1/users01.dbf

skipping datafile 5; already restored to file /u03/oradata/test1/rman_tbs.dbf

skipping datafile 1; already restored to file /u03/oradata/test1/system01.dbf

skipping datafile 2; already restored to file /u04/oradata/test1/undotbs01.dbf

skipping datafile 3; already restored to file /u03/oradata/test1/sysaux01.dbf

restore not done; all files readonly, offline, or already restored

Finished restore at 20-NOV-07

contents of Memory Script:

{

switch clone datafile all;

}

executing Memory Script

datafile 1 switched to datafile copy

input datafile copy recid=1 stamp=639143579 filename=/u03/oradata/test1/system01.dbf

datafile 2 switched to datafile copy

input datafile copy recid=2 stamp=639143579 filename=/u04/oradata/test1/undotbs01.dbf

datafile 3 switched to datafile copy

input datafile copy recid=3 stamp=639143580 filename=/u03/oradata/test1/sysaux01.dbf

datafile 4 switched to datafile copy

input datafile copy recid=4 stamp=639143580 filename=/u01/oradata/test1/users01.dbf

datafile 5 switched to datafile copy

input datafile copy recid=5 stamp=639143580 filename=/u03/oradata/test1/rman_tbs.dbf

contents of Memory Script:

{

set until scn 1232983;

recover

standby

clone database

delete archivelog

;

}

executing Memory Script

executing command: SET until clause

Starting recover at 20-NOV-07

using channel ORA_AUX_DISK_1

using channel ORA_AUX_DISK_2

starting media recovery

archive log thread 1 sequence 36 is already on disk as file /u04/arch1/test1/1_36_637945588.arc

archive log thread 1 sequence 37 is already on disk as file /u04/arch1/test1/1_37_637945588.arc

archive log thread 1 sequence 38 is already on disk as file /u04/arch1/test1/1_38_637945588.arc

archive log filename=/u04/arch1/test1/1_36_637945588.arc thread=1 sequence=36

archive log filename=/u04/arch1/test1/1_37_637945588.arc thread=1 sequence=37

archive log filename=/u04/arch1/test1/1_38_637945588.arc thread=1 sequence=38

channel ORA_AUX_DISK_1: starting archive log restore to default destination

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=39

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=40

channel ORA_AUX_DISK_1: restoring archive log

archive log thread=1 sequence=41

channel ORA_AUX_DISK_1: reading from backup piece /u03/rman/bkup/rmanbk_TEST111639142479

channel ORA_AUX_DISK_1: restored backup piece 1

piece handle=/u03/rman/bkup/rmanbk_TEST111639142479 tag=TAG20071120Txxxx

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:08

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_39_637945588.arc thread=1 sequence=39

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_39_637945588.arc recid=1 stamp=639143604

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_40_637945588.arc thread=1 sequence=40

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_40_637945588.arc recid=3 stamp=639143607

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_41_637945588.arc thread=1 sequence=41

channel clone_default: deleting archive log(s)

archive log filename=/opt/app/oracle/product/10.2.0/dbs/arch1_41_637945588.arc recid=2 stamp=639143606

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

Finished recover at 20-NOV-07

Finished Duplicate Db at 20-NOV-07

RMAN>

0 comments: