Friday, 19 December 2014

Exploring Oracle Data Guard - Part 2

Let's get the ball rolling, shall we ?

Server : oracle10gr2primary , oracle10gr2standby

Preparing Database :

On primary database server : oracle10gr2primary 

1) Verify if archiving is enabled and verify archive log files :

   SQL> archive log list;
    Database log mode                Archive Mode
    Automatic archival                  Enabled
    Archive destination                 USE_DB_RECOVERY_FILE_DEST
    Oldest online log sequence     1
    Next log sequence to archive   3
    Current log sequence              3


2) If it isn't already enabled... enable 'force logging':

    SQL> alter database force logging;
              Database altered.


3) Configure standby redo logs:

   SQL>alter database add standby logfile group 11 '/u01/oradata/TESTDG/standby_redo01.log' size 50m;
    SQL>alter database add standby logfile group 12 '/u01/oradata/TESTDG/standby_redo02.log' size 50m;
    SQL>alter database add standby logfile group 13 '/u01/oradata/TESTDG/standby_redo03.log' size 50m;
    SQL>alter database add standby logfile group 14 '/u01/oradata/TESTDG/standby_redo04.log' size 50m;



NB1: The standby redo log size must be equal to redo log size.


NB2: The standby redo log groups must be one more than the redo log groups.

NB3: Frankly speaking it isn't necessary to create the standby redo logs on the primary database during this phase, because these logs will be used by the database only in case of a switchover event.

4) Ensure that Flash Recovery Area is enabled :

   SQL> show parameter recovery
   NAME                                 TYPE        VALUE
    ------------------------------------ ----------- ------------------------------
   db_recovery_file_dest                string           /u01/orabackup
   db_recovery_file_dest_size         big integer     8048M


5) Modify the init parameter file of the primary database according to these values:


alter system set db_unique_name='TESTDGP' scope=spfile;
alter system set log_archive_config='DG_CONFIG=(TESTDGP,TESTDGS)' scope=spfile;
alter system set log_archive_dest_1='LOCATION=/u02/oraarch/TESTDG VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=TESTDGP' scope=spfile;
alter system set log_archive_dest_2='SERVICE=TESTDGS LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLES) DB_UNIQUE_NAME=TESTDGS' scope=spfile;
alter system set log_archive_dest_state_1=ENABLE scope=spfile;
alter system set log_archive_dest_state_2=ENABLE scope=spfile;
alter system set log_archive_max_processes=8 scope=spfile;
alter system set log_archive_format='%t_%s_%r.dbf'  scope=spfile;
alter system set standby_file_management='AUTO' scope=spfile;
alter system set fal_server='TESTDGS' scope=spfile;
alter system set fal_client='TESTDGP' scope=spfile;
alter system set standby_archive_dest='/u02/oraarch/TESTDG' scope=spfile;



No comments:

Post a Comment