Tuesday 31 March 2020

Add online redo log group in standby database

How to add online redo log group in standby database
1. Change the value of standby database state to "APPLY-OFF" in dgmgrl
DGMGRL> show database verbose testdgbdr;

Database - testdgbdr 

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON

DGMGRL> edit database testdgbdr set state='APPLY-OFF';
DGMGRL> show database verbose testdgbdr;

Database - testdgbdr 

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-OFF

2. Add online redo log group in standby database
SQL> select db_unique_name from v$database

DB_UNIQUE_NAME
------------------------------
testdgbdr 

SQL> select group#, bytes/1024/1024 MB from v$log;

    GROUP#         MB
---------- ----------
         1         50
         2         50
         3         50

SQL> alter database add logfile group 4 ('/u01/app/redo/testdgb/redo04.log') SIZE 50M;

Database altered.

SQL> select group#, bytes/1024/1024 MB from v$log;

    GROUP#         MB
---------- ----------
         1         50
         2         50
         3         50
         4         50

3. Change the value of standby database state to "APPLY-ON" in dgmgrl
DGMGRL> show database verbose testdgbdr;

Database - testdgbdr 

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-OFF

DGMGRL> edit database testdgbdr set state='APPLY-ON';
DGMGRL> show database verbose testdgbdr;

Database - testdgbdr 

  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON

Show configuration with warning ORA-16792: configurable property value is inconsistent with database setting

Here is the example how to resolve the warning with ORA-16792: configurable property value is inconsistent with database setting in dgmgrl.

DGMGRL> show configuration;

Configuration - testdgb_dg_config

  Protection Mode: MaxAvailability
  Members:
  testdgb - Primary database
    testdgbdr - Physical standby database 
      Warning: ORA-16792: configurable property value is inconsistent with database setting

Fast-Start Failover: DISABLED

Configuration Status:
WARNING   (status updated 32 seconds ago)

DGMGRL> show database testdgbdr 'InconsistentProperties';
INCONSISTENT PROPERTIES
INSTANCE_NAME   PROPERTY_NAME          MEMORY_VALUE   SPFILE_VALUE    BROKER_VALUE 
testdgb         StandbyFileManagement  MANUAL         MANUAL          AUTO 

The broker value of "StandbyFileMangement" is inconsistent with database spfile and memory value, so we need to align the broker value "StandbyFileMangement" with database config.

DGMGRL> edit database testdgbdr set property StandbyFileManagement='MANUAL';
Property "standbyfilemanagement" updated

Check again the database DG broker inconsistent property after updated the value.

DGMGRL> show database testdgbdr 'InconsistentProperties';
INCONSISTENT PROPERTIES
INSTANCE_NAME   PROPERTY_NAME          MEMORY_VALUE   SPFILE_VALUE    BROKER_VALUE 

The warning ORA-16792 has been resolved after amended the value in database property. 
DGMGRL> show configuration;

Configuration - testdgb_dg_config

  Protection Mode: MaxAvailability
  Members:
  testdgb      - Primary database
    testdgbdr - Physical standby database 

Fast-Start Failover: DISABLED

Configuration Status:
SUCCESS   (status updated 41 seconds ago)