Friday, April 24, 2015

How to Bounce Oracle11g Active Data Guard Standby Database?

This post is tested in Oracle 11.2.0.4 Active Data Guard instance.  This step works on 11.1.0.7, 11.2.0.2, 11.2.0.4 as well.  Let us assume, we have primary and standby database and we need to shutdown the standby database for maintenance schedule.


Step1
Tail the alert log on  both primary and standby for monitoring the database.
tail -f  alert_$ORACLE_SID.log

Defer  the log shipping in primary database.
Login to primary database and run the below command to defer the log shipping. Assuming, log_archive_dest_state_2 is standby location.

alter system set log_archive_dest_state_2='DEFER' scope=both;


Step2
Login to standby database and shutdown the database.

alter database recover managed standby database cancel;
shutdown immediate

After the maintenance schedule is over, then bring the standby instance.

Step3
Login to primary instance and enable the log shipping.

alter system set log_archive_dest_state_2='ENABLE' scope=both;

Step4
Login to standby instance, run the below command.

startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;

Leave the standby instance for few min to catch up the logs and run the rest of the commands.

alter database recover managed standby database cancel;
alter database open;
alter database recover managed standby database using current logfile disconnect;

Check the alert logs on the both primary and standby and make sure no errors.

Please remember, It will be different steps to bounce the Oracle10g  standby database. Since Oracle10g is not an active Data Guard.  Please click here to view the steps to bounce the Oracle10g data guard standby database.

No comments: