Wednesday, August 9, 2017


#############################################
Database Name :- TESTMP1
Primary db_unique_name :- TESTMP1
Standby db_unique_name :- TESTMP2
############################################




Step 1
Set Parameter for LOG_ARCHIVE_CONFIG
alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(TESTMP1,TESTMP2)';


Step 2
Set primary Log Archive Destination
alter system set LOG_ARCHIVE_DEST_1='LOCATION=/testqa/oraagent/agent1 VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=TESTMP1';

Step 3
Set standby log archive destination
alter system set LOG_ARCHIVE_DEST_2='SERVICE=TESTMP2 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=TESTMP2';



Step 4
Enable LOG_ARCHIVE_DEST_1
alter system set LOG_ARCHIVE_DEST_STATE_1=ENABLE;


Step 5
Setup  FAL_SERVER & FAL_CLIENT 

alter system set FAL_SERVER=TESTMP2;
alter system set FAL_CLIENT=TESTMP1;



Step 6
Set Parameters for FILE_NAME_CONVERT
alter system set DB_FILE_NAME_CONVERT='+TESTQAINDX2/','+TESTINTDATA2/' scope=spfile;
alter system set LOG_FILE_NAME_CONVERT='+TESTQAINDX2/','+TESTINTDATA2/' scope=spfile;



Step 7
*On standby* Add listener entry 

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
     (GLOBAL_DBNAME = TESTMP2)
     (ORACLE_HOME = /testqa/oradb/db1)
     (SID_NAME = TESTMP2)
    )
   )


Step 8  
Add entries to tnsnames.ora to both nodes
TESTMP1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.108.256.249)(PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = TESTMP1))
  )
TESTMP2 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.108.256.251)(PORT = 1521))
    )
    (CONNECT_DATA = (SERVICE_NAME = TESTMP2))
  )



Step 9
 Copy Password file onto standby or create password file with same password

copy password file
orapwd file=/testqa/oradb/db1/dbs/orapwTESTMP1 force=y password=sys
orapwd file=/testqa/oradb/db1/dbs/orapwTESTMP2 force=y password=sys


Step 10
Create  Standby Pfile
 Only one parameter needed - > DB_NAME
 DB_NAME=TESTMP2


Step 11  
Startup Standby
sqlplus / as sysdba
startup nomount


Step 12
On primary system 
rman target sys/sys@TESTMP1 auxiliary sys/sys@TESTMP2

run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
  parameter_value_convert 'TESTMP1','TESTMP2'
  set db_unique_name='TESTMP2'
  set db_file_name_convert='+TESTQAINDX2/','+TESTINTDATA2/'
  set log_file_name_convert='+TESTQAINDX2/','+TESTINTDATA2/'
  set control_files='+TESTINTDATA2/control01.ctl'
  set log_archive_max_processes='5'
  set fal_client='TESTMP2'
  set fal_server='TESTMP1'
  set standby_file_management='AUTO'
  set log_archive_config='dg_config=(TESTMP1,TESTMP2)'
  set log_archive_dest_2='SERVICE=TESTMP2 ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=TESTMP2'
;
}



Step 14
*On standby* For active Dataguard 
alter database recover managed standby database cancel;
alter database open;
alter database recover managed standby database disconnect;

No comments:

Post a Comment

  How to Change Instance Type & Security Group of EC2 in AWS By David Taylor Updated April 29, 2023 EC2 stands for Elastic Compute Cloud...