Create Standby Database using 11g DUPLICATE FROM ACTIVE DATABASE

Create Standby Database using 11g DUPLICATE FROM ACTIVE DATABASE

-bash-3.2$ rman TARGET sys/orclDB123@orcldb AUXILIARY sys/orclDB123@dbstby

Recovery Manager: Release 11.2.0.2.0 – Production on Wed Feb 27 02:38:01 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: orcldb (DBID=476237336)
connected to auxiliary database: orcldb (not mounted)

RMAN> DUPLICATE TARGET DATABASE
FOR STANDBY
FROM ACTIVE DATABASE
DORECOVER
SPFILE
SET db_unique_name=’dbstby’ COMMENT ‘Is standby’
SET LOG_ARCHIVE_DEST_2=’SERVICE=orcldb ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMA7> RY_ROLE)     DB_UNIQUE_NAME=orcldb’
SET FAL_SERVER=’orcldb’ COMMENT ‘Is primary’
SET audit_file_dest=’/u01/app/oracle/admin/dbstby/adump’
SET db_file_name_convert=’/u01/app/oracle/oradata/orcldb’,’/u01/app/oracle/or9> 10> adata/dbstby’
SET log_file_name_convert=’/u01/app/oracle/oradata/orcldb’,’/u01/app/oracle/oradata/dbstby’
SET CONTROL_FILES=’/u01/app/oracle/oradata/dbstby/control01.ctl’,’/u01/app/o11> 12> racle/fast_recovery_area/dbstby/control02.ctl’
NOFILENAMECHECK;

Starting Duplicate Db at 27-FEB-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=585 device type=DISK

contents of Memory Script:
{
backup as copy reuse
targetfile  ‘/u01/app/oracle/product/11.2.0/db_1/dbs/orapworcldb’ auxiliary format
‘/u01/app/oracle/product/11.2.0/db_1/dbs/orapwdbstby’   targetfile
‘/u01/app/oracle/product/11.2.0/db_1/dbs/spfileorcldb.ora’ auxiliary format
‘/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledbstby.ora’   ;
sql clone “alter system set spfile= ”/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledbstby.ora””;
}
executing Memory Script

Starting backup at 27-FEB-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=590 device type=DISK
Finished backup at 27-FEB-13

sql statement: alter system set spfile= ”/u01/app/oracle/product/11.2.0/db_1/dbs/spfiledbstby.ora”

contents of Memory Script:
{
sql clone “alter system set  db_unique_name =
”dbstby” comment=
”Is standby” scope=spfile”;
sql clone “alter system set  LOG_ARCHIVE_DEST_2 =
”SERVICE=orcldb ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldb” comment=
”” scope=spfile”;
sql clone “alter system set  FAL_SERVER =
”orcldb” comment=
”Is primary” scope=spfile”;
sql clone “alter system set  audit_file_dest =
”/u01/app/oracle/admin/dbstby/adump” comment=
”” scope=spfile”;
sql clone “alter system set  db_file_name_convert =
”/u01/app/oracle/oradata/orcldb”, ”/u01/app/oracle/oradata/dbstby” comment=
”” scope=spfile”;
sql clone “alter system set  log_file_name_convert =
”/u01/app/oracle/oradata/orcldb”, ”/u01/app/oracle/oradata/dbstby” comment=
”” scope=spfile”;
sql clone “alter system set  CONTROL_FILES =
”/u01/app/oracle/oradata/dbstby/control01.ctl”, ”/u01/app/oracle/fast_recovery_area/dbstby/control02.ctl” comment=
”” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_unique_name =  ”dbstby” comment= ”Is standby” scope=spfile

sql statement: alter system set  LOG_ARCHIVE_DEST_2 =  ”SERVICE=orcldb ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcldb” comment= ”” scope=spfile

sql statement: alter system set  FAL_SERVER =  ”orcldb” comment= ”Is primary” scope=spfile

sql statement: alter system set  audit_file_dest =  ”/u01/app/oracle/admin/dbstby/adump” comment= ”” scope=spfile

sql statement: alter system set  db_file_name_convert =  ”/u01/app/oracle/oradata/orcldb”, ”/u01/app/oracle/oradata/dbstby” comment= ”” scope=spfile

sql statement: alter system set  log_file_name_convert =  ”/u01/app/oracle/oradata/orcldb”, ”/u01/app/oracle/oradata/dbstby” comment= ”” scope=spfile

sql statement: alter system set  CONTROL_FILES =  ”/u01/app/oracle/oradata/dbstby/control01.ctl”, ”/u01/app/oracle/fast_recovery_area/dbstby/control02.ctl” comment= ”” scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1068937216 bytes

Fixed Size                     2233336 bytes
Variable Size                616565768 bytes
Database Buffers             444596224 bytes
Redo Buffers                   5541888 bytes

contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format  ‘/u01/app/oracle/oradata/dbstby/control01.ctl’;
restore clone controlfile to  ‘/u01/app/oracle/fast_recovery_area/dbstby/control02.ctl’ from
‘/u01/app/oracle/oradata/dbstby/control01.ctl’;
}
executing Memory Script

Starting backup at 27-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_orcldb.f tag=TAG20130227T023833 RECID=10 STAMP=808454313
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 27-FEB-13

Starting restore at 27-FEB-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=488 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 27-FEB-13

contents of Memory Script:
{
sql clone ‘alter database mount standby database’;
}
executing Memory Script

sql statement: alter database mount standby database

contents of Memory Script:
{
set newname for tempfile  1 to
“/u01/app/oracle/oradata/dbstby/temp01.dbf”;
switch clone tempfile all;
set newname for datafile  1 to
“/u01/app/oracle/oradata/dbstby/system01.dbf”;
set newname for datafile  2 to
“/u01/app/oracle/oradata/dbstby/sysaux01.dbf”;
set newname for datafile  3 to
“/u01/app/oracle/oradata/dbstby/undotbs01.dbf”;
set newname for datafile  4 to
“/u01/app/oracle/oradata/dbstby/users01.dbf”;
backup as copy reuse
datafile  1 auxiliary format
“/u01/app/oracle/oradata/dbstby/system01.dbf”   datafile
2 auxiliary format
“/u01/app/oracle/oradata/dbstby/sysaux01.dbf”   datafile
3 auxiliary format
“/u01/app/oracle/oradata/dbstby/undotbs01.dbf”   datafile
4 auxiliary format
“/u01/app/oracle/oradata/dbstby/users01.dbf”   ;
sql ‘alter system archive log current’;
}
executing Memory Script

executing command: SET NEWNAME

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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 27-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/orcldb/system01.dbf
output file name=/u01/app/oracle/oradata/dbstby/system01.dbf tag=TAG20130227T023842
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/orcldb/sysaux01.dbf
output file name=/u01/app/oracle/oradata/dbstby/sysaux01.dbf tag=TAG20130227T023842
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/orcldb/undotbs01.dbf
output file name=/u01/app/oracle/oradata/dbstby/undotbs01.dbf tag=TAG20130227T023842
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/orcldb/users01.dbf
output file name=/u01/app/oracle/oradata/dbstby/users01.dbf tag=TAG20130227T023842
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 27-FEB-13

sql statement: alter system archive log current

contents of Memory Script:
{
backup as copy reuse
archivelog like  “/u01/app/oracle/oraarch/1_41_808369563.arc” auxiliary format
“/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc”   archivelog like
“/u01/app/oracle/oraarch/1_42_808369563.arc” auxiliary format
“/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc”   ;
catalog clone archivelog  “/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc”;
catalog clone archivelog  “/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc”;
switch clone datafile all;
}
executing Memory Script

Starting backup at 27-FEB-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=41 RECID=51 STAMP=808454325
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=42 RECID=52 STAMP=808454459
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 27-FEB-13

cataloged archived log
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc RECID=1 STAMP=808454742

cataloged archived log
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc RECID=2 STAMP=808454742

datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=808454742 file name=/u01/app/oracle/oradata/dbstby/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=11 STAMP=808454742 file name=/u01/app/oracle/oradata/dbstby/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=808454742 file name=/u01/app/oracle/oradata/dbstby/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=13 STAMP=808454742 file name=/u01/app/oracle/oradata/dbstby/users01.dbf

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

executing command: SET until clause

Starting recover at 27-FEB-13
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 41 is already on disk as file /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc
archived log for thread 1 with sequence 42 is already on disk as file /u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_41_808369563.arc thread=1 sequence=41
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/arch1_42_808369563.arc thread=1 sequence=42
media recovery complete, elapsed time: 00:00:00
Finished recover at 27-FEB-13
Finished Duplicate Db at 27-FEB-13

RMAN>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s