Friday, April 18, 2014

Oracle Data Guard Broker Configuration management

Configuration management

1.       Change parameter, database property using DGMGRL

We will change the property 'StandbyFileManagement' for database ORCL2 to AUTO from MANUAL which is default setting for the parameter STANDBY_FILE_MANAGEMENT.

                edit database orcl2 set property 'StandbyFileManagement'='AUTO';
      
      
       DGMGRL> show database verbose orcl2
      
       Database - orcl2
      
         Role:            PHYSICAL STANDBY
         Intended State:  APPLY-ON
         Transport Lag:   0 seconds
         Apply Lag:       0 seconds
         Real Time Query: OFF
         Instance(s):
           orcl2
      
         Properties:
           DGConnectIdentifier             = 'orcl2'
           ObserverConnectIdentifier       = ''
           LogXptMode                      = 'ASYNC'
           DelayMins                       = '0'
           Binding                         = 'OPTIONAL'
           MaxFailure                      = '0'
           MaxConnections                  = '1'
           ReopenSecs                      = '300'
           NetTimeout                      = '30'
           RedoCompression                 = 'DISABLE'
           LogShipping                     = 'ON'
           PreferredApplyInstance          = ''
           ApplyInstanceTimeout            = '0'
           ApplyParallel                   = 'AUTO'
           StandbyFileManagement           = 'AUTO'
           ArchiveLagTarget                = '0'
           LogArchiveMaxProcesses          = '4'
           LogArchiveMinSucceedDest        = '1'
           DbFileNameConvert               = 'orcl1, orcl2'
           LogFileNameConvert              = 'orcl1, orcl2'
           FastStartFailoverTarget         = ''
           StatusReport                    = '(monitor)'
           InconsistentProperties          = '(monitor)'
           InconsistentLogXptProps         = '(monitor)'
           SendQEntries                    = '(monitor)'
           LogXptStatus                    = '(monitor)'
           RecvQEntries                    = '(monitor)'
           HostName                        = 'dg3'
           SidName                         = 'orcl2'
           StaticConnectIdentifier         = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dg3)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl2_DGMGRL)(INSTANCE_NAME=orcl2)(SERVER=DEDICATED)))'
           StandbyArchiveLocation          = 'USE_DB_RECOVERY_FILE_DEST'
           AlternateLocation               = ''
           LogArchiveTrace                 = '0'
           LogArchiveFormat                = '%t_%s_%r.dbf'
           TopWaitEvents                   = '(monitor)'
      
       Database Status:
       SUCCESS

We can change the ‘LogXptMode’ property as below. This will update the LOG_ARCHIVE_DEST_n parameter appropriately.
      
       edit database [orcl1|orcl2] set property logxptmode=SYNC;

2.       Change the broker configuration file location

The location of the broker configuration files is determined by the parameters DG_BROKER_CONFIG_FILEn (where n in {1,2}).

Default location is $ORACLE_HOME/dbs
Default names of configuration files are:  dr{1|2}<db_unique_name>             

CHANGING CONFIG FILE LOCATION:
               
The location of the configuration file can only be changed when DMON is not running.
                               
·         set DG_BROKER_START=FALSE
·         alter system set DG_BROKER_CONFIG_FILEn=new loc;
·         manually move files at OS level to new location
                                IF old/new location is ASM, use DBMS_FILE_TRANSFER.COPY_FILE
·         start DMON process

3.       Change DB STATEs

Turn off redo apply,

                edit database orcl2 set STATE='APPLY-OFF';

        Activate active DG aka REAL TIME QUERY,
               
                edit database orcl2 set STATE='APPLY-OFF';

       SQL> alter database open;

       edit database orcl2 set STATE='APPLY-ON';
      
       DGMGRL> show database orcl2
      
       Database - orcl2
      
         Role:            PHYSICAL STANDBY
         Intended State:  APPLY-ON
         Transport Lag:   0 seconds
         Apply Lag:       0 seconds
         Real Time Query: ON
         Instance(s):
           orcl2
      
       Database Status:
       SUCCESS

4.       Change protection mode

a)      Configure the SRL if necessary
b)      Set LogXptMode aptly
                               
edit database orcl1 set property 'LogXptMode'='SYNC';
edit database orcl2 set property 'LogXptMode'='SYNC';
                               
c)       now change the mode for the ENTIRE CONFIGURATION
               
                edit configuration set protection mode as MaxAvailability;
                               
         Effects:
               
                In the STANDBY alert log:
                               
                RFS[6]: Assigned to RFS process 7356
RFS[6]: Identified database type as 'physical standby': Client is LGWR SYNC pid 4753
Primary database is in MAXIMUM AVAILABILITY mode
Changing standby controlfile to MAXIMUM AVAILABILITY mode
Standby controlfile consistent with primary
RFS[6]: Selected log 4 for thread 1 sequence 65 dbid 1224670660 branch 840221191
Recovery of Online Redo Log: Thread 1 Group 4 Seq 65 Reading mem 0
Mem# 0: /u01/app/oracle/oradata/orcl2/srl04.log
Wed Mar 12 01:05:58 2014
RFS[7]: Assigned to RFS process 7366
RFS[7]: Identified database type as 'physical standby': Client is ARCH pid 4817

On the PRIMARY Site

SQL> select dest_id, dest_name, status, affirm, transmit_mode, process from v$archive_dest where status != 'INACTIVE';

DEST_ID DEST_NAME                      STATUS    AFF TRANSMIT_MOD PROCESS
---------- ------------------------------ --------- --- ------------ ----------
1 LOG_ARCHIVE_DEST_1             VALID     NO  SYNCHRONOUS  ARCH
2 LOG_ARCHIVE_DEST_2             VALID     YES PARALLELSYNC LGWR

On STANDBY site :

SQL> select dest_id, dest_name, status, affirm, transmit_mode, process from v$archive_dest where status != 'INACTIVE';

DEST_ID DEST_NAME                      STATUS    AFF TRANSMIT_MOD PROCESS
---------- ------------------------------ --------- --- ------------ ----------
1 LOG_ARCHIVE_DEST_1             VALID     NO  SYNCHRONOUS  ARCH
2 LOG_ARCHIVE_DEST_2             VALID     NO  ASYNCHRONOUS LGWR

32 STANDBY_ARCHIVE_DEST           VALID     YES SYNCHRONOUS  RFS

No comments:

Post a Comment