Thursday, December 27, 2012

How to disable and enable logshipping when your standby database is in maximum availabilty through DataGuard Broker Architecture


We may not be able to disable the log transport when the database is in maximum availability mode. We may get the below error


DGMGRL> edit database 'DBNAME' set state=TRANSPORT-OFF;
Error: ORA-16627: operation disallowed since no standby databases would remain to support protection mode

We may need to transfer the mode to maximum performance and disable the log transport.

1. Disable Log shipping

  1.1. Connect to dgmgrl broker
  $dgmgrl sys/welcome

 1.2  Verify the protection mode

 DGMGRL> show configuration
Configuration - DBNAME
  Protection Mode: MaxAvailability
  Databases:
    DBNAME    - Primary database
    DBNAME_SB - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS


1.3 Disable the log apply in standby database
DGMGRL>  EDIT DATABASE 'DBNAME_SB' SET STATE='APPLY-OFF';  

1.4 Convert the database into maximum performance mode
DGMGRL>  EDIT CONFIGURATION SET PROTECTION MODE AS MAXPERFORMANCE;
   
1.5  Verify the configutaion
DGMGRL> show configuration
Configuration - DBNAME
  Protection Mode: MaxPerformance
  Databases:
    DBNAME    - Primary database
    DBNAME_SB - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

1.6  Disable to the log transport
DGMGRL> edit database 'DBNAME' set state='LOG-TRANSPORT-OFF';

1.7 Verify the configuration in verbose mode
DGMGRL> show database verbose 'DBNAME'
  Database - DBNAME
  Role:            PRIMARY
  Intended State:  TRANSPORT-OFF
  Instance(s):
   .....

2. Enable Log shipping

2 .1 EDIT DATABASE 'DBNAME_SB' SET STATE='APPLY-ON';
2 .2 EDIT DATABASE 'DBNAME'  SET STATE='TRANSPORT-ON';
2 .3 EDIT CONFIGURATION SET PROTECTION MODE AS  'MAXAVAILABILITY'


For disable the log transport when the database is in maximum performance mode

DGMGRL> edit database 'DBNAME' set state=TRANSPORT-OFF;

DGMGRL> edit database 'DBNAME' set state=TRANSPORT-ON; 

1 comment:

  1. Hi,
    Is it possible to Switch Back after the role transition has occurred , i.e whenever a primary database is down and the standby database becomes primary database.

    ReplyDelete