DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Tuesday, January 17, 2017

Creating Cascading standby database

 A cascading standby database is a standby database that receives its redo logs from another standby database, not from the original primary database.

Primary Database      ----- >    Cascading Standby Database     -----> Cascaded Standby Database
(FEMP01 – primary.na)            (DRFEMP01 – standby.na)               (FEMCSD – csdstby.na)       


High Level Steps
·         Create a pfile for the cascading standby FEMCSD.
·         Copy the password file from the DRFEMP01 and rename it to FEMCSD.
·         Create the listener and enter the TNS Entries in the tnsnames.ora
·         Add/modify the log_archive_dest_2 parameter in the Primary(FEMP01) and DR(DRFEMP01) instance
·         Stop the recovery process in the DR database (DRFEMP01)
·         Start the active duplicate standby creation
Low Level Steps
1.       Enable the log_archive_dest_2_state in DRFEMP01.
2.       Start the MRP process in FEMCSD
3.       Enable the monitoring scripts for FEMCSD


a.       Create a pfile for the cascading standby FEMCSD.
*.STANDBY_FILE_MANAGEMENT='AUTO'
*.FAL_SERVER='DRFEMP01'
*.FAL_CLIENT='FEMCSD'
log_archive_config='dg_config=(FEMP01,DRFEMP01,FEMCSD)'
log_archive_dest_1='location=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ONLINE_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=FEMCSD'
log_archive_dest_2='service=DRFEMP01valid_for=(STANDBY_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DRFEMP01'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
DB_FILE_NAME_CONVERT='+IMPRD_DATA_DG/DRFEMP01','+IMTST_DATA_DG/FEMCSD'
LOG_FILE_NAME_CONVERT='+IMPRD_DATA_DG/DRFEMP01/ONLINELOG','+IMTST_DATA_DG/FEMCSD/ONLINELOG'

b.      Copy the password file from the DRFEMP01 and rename it to FEMCSD.
c.       Create the listener and enter the TNS Entries in the tnsnames.ora
LISTENER_FEMCSD =
  (ADDRESS_LIST=
        (ADDRESS=
         (PROTOCOL=TCP) (HOST=oh61g.example.com) (PORT=1530))
  )
SID_LIST_LISTENER_FEMCSD =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /im/tironi/db/FEMCSD/11.2.0.4)
      (SID_NAME = FEMCSD)
    )
  )

TNS ENTRY
FEMCSD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oh61g.example.com)(PORT = 1530))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
     (SERVICE_NAME = FEMCSD2)
    )
  )
d.      Add/modify the log_archive_dest_2 parameter in the Primary(FEMP01) and DR(DRFEMP01) instance,
Primary (FEMP01)

alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(FEMP01,DRFEMP01,FEMCSD)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='SERVICE=DRFEMP01 LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=DRFEMP01';
alter system set LOG_ARCHIVE_DEST_3='SERVICE=FEMCSD LGWR SYNC VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=FEMCSDS'scope=both;
alter system set LOG_ARCHIVE_DEST_STATE_3=DEFER;(This parameter will remain in DEFER state permanently)

DR (DRFEMP01)

alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(FEMP01,DRFEMP01,FEMCSD)' scope=both;
alter system set LOG_ARCHIVE_DEST_2='service=FEMP01valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=FEMP01';
alter system set LOG_ARCHIVE_DEST_3='SERVICE=FEMCSD LGWR SYNC VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=FEMCSD'scope=both;
alter system set LOG_ARCHIVE_DEST_STATE_3=DEFER;(This parameter will remain in DEFER state permanently)

e.      Create necessary directories in the ASM in oh61g.example.com server

a.       Stop the recovery process in the DR database (DRFEMP01)
alter database recover managed standby database using current logfile disconnect from session;





f.        Connect to RMAN with target as DR(DRFEMP01) and auxiliary as Cascaded standby(FEMCSD) and start the active duplicate standby creation.
run
{
ALLOCATE CHANNEL tgt10 TYPE DISK;
ALLOCATE CHANNEL tgt20 TYPE DISK;
ALLOCATE CHANNEL tgt30 TYPE DISK;
ALLOCATE CHANNEL tgt40 TYPE DISK;
ALLOCATE CHANNEL tgt50 TYPE DISK;
ALLOCATE CHANNEL tgt60 TYPE DISK;
ALLOCATE CHANNEL tgt70 TYPE DISK;
ALLOCATE CHANNEL tgt80 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup1 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup2 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup3 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup4 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup5 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup6 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup7 TYPE DISK;
ALLOCATE AUXILIARY CHANNEL dup8 TYPE DISK;
duplicate target database for standby from active database nofilenamecheck;
}

g.       After the clone enable the log_archive_state_3 in the DR(DRFEMP01) and start the recovery process,
alter system set log_archive_dest_state_3=ENABLE scope=both;

alter database recover managed standby database using current logfile disconnect from session;

h.      Start the recovery process in the cascaded standby database (FEMCSD),
alter database recover managed standby database using current logfile disconnect from session;


i.         Schedule the DR Sync check and Archive log removal script for the Cascades standby database(FEMCSD)

No comments: