Creating Physical Standby Using “RMAN DUPLICATE…FROM ACTIVE DATABASE” on Same Host

This article describes the process of creating physical standby using method “RMAN DUPLICATE .. FROM ACTIVE DATABASE“. This feature is available since Oracle release 11.1. At this time I will create physical standby on the same host as where primary database is running. Creating physical standby on a remote host has very similar procedure. Using “RMAN DUP .. FROM ACTIVE DATABASE” makes it possible to not having to take a full backup of primary database, nor the need of having to access to any of existing backup files.
Working environment

  • database name: DB11R2
  • primary database db_unique_name: DB11R2
  • standby database db_unique_name: DB11R2DR

Phase 1) Modifying Primary database

Step 1.1) Ensure primary database is running in archivelog mode

sys@db11r2> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     194
Next log sequence to archive  197
Current log sequence           197

Step 1.2) Enable “Force Logging” on primary database

Force logging ensures complete media recovery. it forces the writing of redo logs even if “NOLOGGING” is specified in object DD L. The database never generates redo records for temporary tablespaces and temporary segments, so forced logging has no affect on them.

sys@db11r2> alter database force logging;
sys@db11r2> select force_logging from v$database;

FORCE_LOGGING
----------------------
YES

Step 1.3) Add standby redo logs on primary database

current redo logs on primary database:


sys@db11r2> select l.group#, member, bytes, l.status from v$log l, v$logfile lf where lf.group#=l.group# order by group#;

    GROUP# MEMBER                                                                                BYTES STATUS
---------- -------------------------------------------------------------------------------- ---------- ----------------
         1 /app/oracle/oradata/DB11R2/redo01.log                                              52428800 CURRENT
         1 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo01_b.log                      52428800 CURRENT
         2 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo02_b.log                      52428800 INACTIVE
         2 /app/oracle/oradata/DB11R2/redo02.log                                              52428800 INACTIVE
         3 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo03_b.log                      52428800 INACTIVE
         3 /app/oracle/oradata/DB11R2/redo03.log                                              52428800 INACTIVE

Add standby redo logs on primary database:


sys@db11r2> alter database add standby logfile group 4 size 50M, group 5 size 50M, group 6 size 50M, group 7 size 50M;
Database altered.

sys@db11r2> select group#, member, type, IS_RECOVERY_DEST_FILE, status from v$logfile;

 GROUP# MEMBER                                                                      TYPE    IS_ STATUS
---------- ------------------------------------------------------------------------ ------- --- -------
 3 /app/oracle/oradata/DB11R2/redo03.log                                            ONLINE  NO
 2 /app/oracle/oradata/DB11R2/redo02.log                                            ONLINE  NO
 1 /app/oracle/oradata/DB11R2/redo01.log                                            ONLINE  NO
 3 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo03_b.log                    ONLINE  NO
 2 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo02_b.log                    ONLINE  NO
 1 /app/oracle/flash_recovery_area/DB11R2/onlinelog/redo01_b.log                    ONLINE  NO
 4 /app/oracle/oradata/DB11R2/onlinelog/o1_mf_4_6mzx09kb_.log                       STANDBY NO
 4 /app/oracle/flash_recovery_area/DB11R2/onlinelog/o1_mf_4_6mzx09o6_.log           STANDBY YES
 5 /app/oracle/oradata/DB11R2/onlinelog/o1_mf_5_6mzx09r4_.log                       STANDBY NO
 5 /app/oracle/flash_recovery_area/DB11R2/onlinelog/o1_mf_5_6mzx0dj9_.log           STANDBY YES
 6 /app/oracle/oradata/DB11R2/onlinelog/o1_mf_6_6mzx0hdf_.log                       STANDBY NO
 6 /app/oracle/flash_recovery_area/DB11R2/onlinelog/o1_mf_6_6mzx0l9m_.log           STANDBY YES
 7 /app/oracle/oradata/DB11R2/onlinelog/o1_mf_7_6mzx0odz_.log                       STANDBY NO
 7 /app/oracle/flash_recovery_area/DB11R2/onlinelog/o1_mf_7_6mzx0r7s_.log           STANDBY YES

Step 1.4) Modify init parameter on primary database for Data Guard.


sys@db11r2> select value from v$parameter where name = 'db_unique_name';

VALUE
----------
DB11R2

sys@db11r2> alter system set log_archive_config='DG_CONFIG=(DB11R2, DB11R2DR)';

System altered.

sys@db11r2> alter system set LOG_ARCHIVE_DEST_1='LOCATION=/app/oracle/flash_recovery_area/DB11R2/onlinelog/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DB11R2';

System altered

sys@db11r2> alter system set LOG_ARCHIVE_DEST_2='SERVICE=DB11R2DR LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DB11R2DR';

System altered.

sys@db11r2> alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;

System altered.

sys@db11r2> alter system set LOG_ARCHIVE_DEST_STATE_2=ENABLE;

System altered.

sys@db11r2> alter system set FAL_SERVER=DB11R2DR;

System altered.

sys@db11r2> alter system set FAL_CLIENT=DB11R2;

System altered.

sys@db11r2> alter system set DB_FILE_NAME_CONVERT='/app/oracle/oradata/DB11R2/','/app/oracle/oradata/DB11R2DR/' scope=spfile;

System altered.

sys@db11r2> alter system set LOG_FILE_NAME_CONVERT='/app/oracle/flash_recovery_area/DB11R2/onlinelog/','/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/' scope=spfile;

System altered.

Ensure the parameter log_archive_max_processes is between 4 and 30.


sys@db11r2> select value from v$parameter where name = 'log_archive_max_processes';

VALUE
-----
4

The archive processes on primary database are responsible for archiving ORL as well as sending archived logs to standby to resolve redo log gap. On the standby site, they are responsible for archiving SRLs and forwarding archived log to cascade standby databases. So we need to specify this parameter to at least 4 with maximum of 30.

Phase 2) Setup SqlNet connectivity between primary database and standby database

In the tnsnames.ora of primary database, add an entry of standby database:

DB11R2DR =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.10)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DB11R2DR)
    )
  )

In the tnsnames.ora of standby database (as we are creating standby on same host, it’s the same as of primary database), add an entry of primary database:

DB11R2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = gchen-pc.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DB11R2)
    )
  )

In the listener.ora of standby database, add a static registration of the standby database to the listener, this is required by RMAN connection to standby when the standby is in nomount status. Otherwise it will issue ORA- error.

LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=gchen-pc.localdomain)(PORT=1521))
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = DB11R2DR)
(ORACLE_HOME = /app/oracle/product/11.2.0/db)
(SID_NAME = DB11R2DR)
)
)

Reload listener to take the changes into effect.

[oracle@gchen-pc admin]$ lsnrctl reload; lsnrctl status

Phase 3) Changes on standby database

Step 3.1) Create a password file for standby database

[oracle@gchen-pc db]$ cd /app/oracle/product/10.2.0/db/dbs
[oracle@gchen-pc dbs]$ orapwd file=orapwDB11R2DR password=iamsys entries=5

Step 3.2) Create a init parameter file for standby database by making changes on init file of primary database

On primary database:

[oracle@gchen-pc dbs]$ export ORACLE_SID=DB11R2
[oracle@gchen-pc dbs]$ sqlplus / as sysdba
sys@db11r2> create pfile='/app/oracle/product/10.2.0/db/dbs/initDB11R2DR.ora' from spfile;

File created.

Modify “/app/oracle/product/10.2.0/db/dbs/initDB11R2DR.ora” to set appropriate values for standby database as marked in bold font.

DB11R2.__db_cache_size=553648128
DB11R2.__java_pool_size=33554432
DB11R2.__large_pool_size=16777216
DB11R2.__oracle_base=’/app/oracle’#ORACLE_BASE set from environment
DB11R2.__pga_aggregate_target=637534208
DB11R2.__sga_target=939524096
DB11R2.__shared_io_pool_size=0
DB11R2.__shared_pool_size=301989888
DB11R2.__streams_pool_size=16777216
*._allow_resetlogs_corruption=TRUE
*.audit_file_dest=’/app/oracle/admin/DB11R2DR/adump’
*.audit_trail=’DB_EXTENDED’
*.compatible=’11.2.0.0.0′
*.control_file_record_keep_time=14
*.control_files=’/app/oracle/oradata/DB11R2DR/control01.ctl’,’/app/oracle/flash_recovery_area/DB11R2DR/controlfile/control02.ctl’
*.db_block_size=8192
*.db_create_file_dest=’/app/oracle/oradata’
*.db_domain=”
*.db_file_name_convert=’/app/oracle/oradata/DB11R2/’,’/app/oracle/oradata/DB11R2DR/’
*.db_name=’DB11R2′
*.db_unique_name=’DB11R2DR’
*.db_recovery_file_dest_size=4294967296
*.db_recovery_file_dest=’/app/oracle/flash_recovery_area’
*.diagnostic_dest=’/app/oracle’
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DB11R2XDB)’
*.fal_client=‘DB11R2’ ‘DB11R2DR’
*.fal_server=‘DB11R2DR’ ‘DB11R2′
*.log_archive_config=’DG_CONFIG=(DB11R2, DB11R2DR)’
*.log_archive_dest_1=’LOCATION=/app/oracle/flash_recovery_area/DB11R2/onlinelog/ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DB11R2′
*.log_archive_dest_1=’LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=DB11R2DR
*.log_archive_dest_2=’SERVICE=DB11R2DR LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DB11R2DR’
*.log_archive_dest_2=’SERVICE=DB11R2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DB11R2
*.log_archive_dest_state_1=’ENABLE’
*.log_archive_dest_state_2=’ENABLE’
*.log_archive_format=’%t_%s_%r.dbf’
*.log_checkpoints_to_alert=TRUE
*.log_file_name_convert=’/app/oracle/flash_recovery_area/DB11R2/onlinelog/’,’/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/’
*.memory_max_target=1572864000
*.memory_target=1572864000
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile=’EXCLUSIVE’
*.resource_manager_plan=’LIMIT_IDLE_TIME_PLAN’
*.sec_case_sensitive_logon=FALSE
*.undo_tablespace=’UNDOTBS1′
*.standby_file_management=AUTO

Step 3.2) Create required directories for standby database

audit directory

[oracle@gchen-pc ~]$ cd /app/oracle/admin
[oracle@gchen-pc admin]$ mkdir -p DB11R2DR/adump

oradata directory

[oracle@gchen-pc admin]$ cd /app/oracle/oradata

[oracle@gchen-pc oradata]$ tree -d DB11R2
DB11R2
|-- onlinelog

[oracle@gchen-pc oradata]$ mkdir -p DB11R2DR/onlinelog

Flash recovery area directory

[oracle@gchen-pc oradata]$ cd /app/oracle/flash_recovery_area/
[oracle@gchen-pc flash_recovery_area]$ tree -d -L 1 DB11R2/
DB11R2/
|-- archivelog
|-- autobackup
|-- backupset
|-- backupset_archivelog
|-- backupset_database
|-- controlfile
|-- onlinelog
`-- snapshot_controlf

[oracle@gchen-pc flash_recovery_area]$ mkdir DB11R2DR
[oracle@gchen-pc flash_recovery_area]$ cd DB11R2DR
[oracle@gchen-pc DB11R2DR]$ mkdir archivelog autobackup backupset backupset_archivelog backupset_database controlfile onlinelog snapshot_controlf

Phase 4) Create standby database using “RMAN DUPLICATE FROM ACTIVE DATABASE”

Step 4.1) Start up standby database in nomount state


[oracle@gchen-pc dbs]$ export ORACLE_SID=DB11R2DR
[oracle@gchen-pc dbs]$ sqlplus / as sysdba
idle> startup nomount;
ORACLE instance started.

Total System Global Area  835104768 bytes
Fixed Size                  2217952 bytes
Variable Size             490735648 bytes
Database Buffers          335544320 bytes
Redo Buffers                6606848 bytes

Step 4.2) From primary database, connect to both primary database and standby database using RMAN

export ORACLE_SID=DB11R2
[oracle@gchen-pc dbs]$ rman target / auxiliary sys/iamsys@db11r2dr

connected to target database: DB11R2 (DBID=4171050541)
connected to auxiliary database (not started)
                                ^^^^^^^^^^^^^
                                (it should be "not mounted", it seems something wrong)

Step 4.3) Run this command to create standby database

RMAN> duplicate target database for standby from active database dorecover;

Starting Duplicate Db at 2011-01-26 10:47:35
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/26/2011 10:47:35
RMAN-06403: could not obtain a fully authorized session
RMAN-04006: error from auxiliary database: ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Linux-x86_64 Error: 2: No such file or directory

After googling the error and check network settings, it turned out to be a result of wrong setting in listener static registration of standby database. I correct it and reload the new setting to listener. Repeat the step 4.2 and 4.3.


[oracle@gchen-pc dbs]$ rman target sys/iamsys@db11r2 auxiliary sys/iamsys@db11r2dr log dup.log

RMAN> duplicate target database for standby from active database dorecover;

To see the output of duplicate process, click on magnifier icon below:


Recovery Manager: Release 11.2.0.1.0 - Production on Thu Jan 27 00:13:29 2011

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

connected to target database: DB11R2 (DBID=4171050541)
connected to auxiliary database: DB11R2 (not mounted)

RMAN>
Starting Duplicate Db at 27-JAN-11
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=134 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '/app/oracle/product/11.2.0/db/dbs/orapwDB11R2' auxiliary format
 '/app/oracle/product/11.2.0/db/dbs/orapwDB11R2DR'   ;
}
executing Memory Script

Starting backup at 27-JAN-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=18 device type=DISK
Finished backup at 27-JAN-11

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/app/oracle/oradata/DB11R2DR/control01.ctl';
   restore clone controlfile to  '/app/oracle/flash_recovery_area/DB11R2DR/controlfile/control02.ctl' from
 '/app/oracle/oradata/DB11R2DR/control01.ctl';
}
executing Memory Script

Starting backup at 27-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/app/oracle/flash_recovery_area/DB11R2/snapshot_controlf/snapcf_DB11R2.f tag=TAG20110127T001543 RECID=8 STAMP=741485744
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 27-JAN-11

Starting restore at 27-JAN-11
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 27-JAN-11

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
 "/app/oracle/oradata/DB11R2DR/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/app/oracle/oradata/DB11R2DR/system01.dbf";
   set newname for datafile  2 to
 "/app/oracle/oradata/DB11R2DR/sysaux01.dbf";
   set newname for datafile  3 to
 "/app/oracle/oradata/DB11R2DR/undotbs01.dbf";
   set newname for datafile  4 to
 "/app/oracle/oradata/DB11R2DR/users01.dbf";
   set newname for datafile  5 to
 "/app/oracle/oradata/DB11R2DR/guang_tbs_01.dbf";
   set newname for datafile  6 to
 "/app/oracle/oradata/DB11R2DR/guang_tbs_02.dbf";
   set newname for datafile  7 to
 "/app/oracle/oradata/DB11R2DR/users02.dbf";
   set newname for datafile  8 to
 "/app/oracle/oradata/DB11R2DR/users03.dbf";
   backup as copy reuse
   datafile  1 auxiliary format
 "/app/oracle/oradata/DB11R2DR/system01.dbf"   datafile
 2 auxiliary format
 "/app/oracle/oradata/DB11R2DR/sysaux01.dbf"   datafile
 3 auxiliary format
 "/app/oracle/oradata/DB11R2DR/undotbs01.dbf"   datafile
 4 auxiliary format
 "/app/oracle/oradata/DB11R2DR/users01.dbf"   datafile
 5 auxiliary format
 "/app/oracle/oradata/DB11R2DR/guang_tbs_01.dbf"   datafile
 6 auxiliary format
 "/app/oracle/oradata/DB11R2DR/guang_tbs_02.dbf"   datafile
 7 auxiliary format
 "/app/oracle/oradata/DB11R2DR/users02.dbf"   datafile
 8 auxiliary format
 "/app/oracle/oradata/DB11R2DR/users03.dbf"   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /app/oracle/oradata/DB11R2DR/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

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 27-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/app/oracle/oradata/DB11R2/system01.dbf
output file name=/app/oracle/oradata/DB11R2DR/system01.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:05
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/app/oracle/oradata/DB11R2/undotbs01.dbf
output file name=/app/oracle/oradata/DB11R2DR/undotbs01.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/app/oracle/oradata/DB11R2/sysaux01.dbf
output file name=/app/oracle/oradata/DB11R2DR/sysaux01.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00008 name=/app/oracle/oradata/DB11R2/users03.dbf
output file name=/app/oracle/oradata/DB11R2DR/users03.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/app/oracle/oradata/DB11R2/guang_tbs_01.dbf
output file name=/app/oracle/oradata/DB11R2DR/guang_tbs_01.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/app/oracle/oradata/DB11R2/users01.dbf
output file name=/app/oracle/oradata/DB11R2DR/users01.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00006 name=/app/oracle/oradata/DB11R2/guang_tbs_02.dbf
output file name=/app/oracle/oradata/DB11R2DR/guang_tbs_02.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00007 name=/app/oracle/oradata/DB11R2/users02.dbf
output file name=/app/oracle/oradata/DB11R2DR/users02.dbf tag=TAG20110127T001554
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 27-JAN-11

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/app/oracle/flash_recovery_area/DB11R2/onlinelog/1_106_725414530.dbf" auxiliary format
 "/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf"   archivelog like
 "/app/oracle/flash_recovery_area/DB11R2/onlinelog/1_107_725414530.dbf" auxiliary format
 "/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf"   ;
   catalog clone archivelog  "/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf";
   catalog clone archivelog  "/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 27-JAN-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=106 RECID=177 STAMP=741485764
output file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf 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=107 RECID=178 STAMP=741485950
output file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 27-JAN-11

cataloged archived log
archived log file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf RECID=1 STAMP=741485953

cataloged archived log
archived log file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf RECID=2 STAMP=741485953

datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/guang_tbs_01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/guang_tbs_02.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/users02.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=15 STAMP=741485953 file name=/app/oracle/oradata/DB11R2DR/users03.dbf

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

executing command: SET until clause

Starting recover at 27-JAN-11
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 106 is already on disk as file /app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf
archived log for thread 1 with sequence 107 is already on disk as file /app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf
archived log file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_106_725414530.dbf thread=1 sequence=106
archived log file name=/app/oracle/flash_recovery_area/DB11R2DR/onlinelog/1_107_725414530.dbf thread=1 sequence=107
media recovery complete, elapsed time: 00:00:01
Finished recover at 27-JAN-11
RMAN-05535: WARNING: All redo log files were not defined properly.
RMAN-05535: WARNING: All redo log files were not defined properly.
RMAN-05535: WARNING: All redo log files were not defined properly.
Finished Duplicate Db at 27-JAN-11

Phase 5) Connect to standby database and start MRP (Managed Recovery Process)

export ORACLE_SID=DB11R2DR
sqlplus / as sysdba

idle> shutdown immediate;
idl> starup
Database opened.

sys@db11r2dr> recover managed standby database using current logfile disconnect;
Media recovery complete.

[oracle@gchen-pc dbs]$ ps -ef |grep mrp
oracle    8346     1  0 00:45 ?        00:00:01 ora_mrp0_DB11R2DR
oracle    8370  5019  0 00:47 pts/2    00:00:00 grep mrp

Advertisements

One Trackback to “Creating Physical Standby Using “RMAN DUPLICATE…FROM ACTIVE DATABASE” on Same Host”

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

%d bloggers like this: