top of page
  • Writer's pictureArun Kumar

Data Guard Broker Failover

It’s very simple to perform failover using data guard broker. If primary database is unavailable, we can activate standby using below method.

Note: A failover is when you have lost primary database.

Crash Primary database

Let us simulate failure. We will kill the PMON process at OS level on primary

On primary:
[oracle@prod admin]$ ps -ef|grep pmon
grid      2636     1  0 Apr15 ?        00:00:12 asm_pmon_+ASM
oracle   16914     1  0 14:03 ?        00:00:00 ora_pmon_proddb
oracle   17722 15893  0 15:08 pts/0    00:00:00 grep pmon

[oracle@prod admin]$ kill -9 16914 

Failover to Standby

Connect to standby database proddb_st (as primary crashed or not available) and failover to standby proddb_st

On standby:
dgmgrl sys/sys@proddb_st

DGMGRL> show configuration;
Performing failover NOW, please wait...
Failover succeeded, new primary is "proddb_st"
DGMGRL> show configuration;

Rebuild Primary After Failover

Post failover, there are two methods of rebuilding your failed primary

  • Method 1: Rebuild from scratch –> RMAN duplicate

  • Method 2: Flashback database –> only if Flashback was enabled

Reinstate failed primary: When you use data guard broker, with just one command, the primary can be rebuilt. Start the failed primary server, in this case start proddb server

On current primary (proddb_st):
dgmgrl sys/sys@proddb_st

DGMGRL> show configuration;

DGMGRL> reinstate database proddb;
Reinstating database "proddb", please wait...
Operation requires shutdown of instance "proddb" on database "proddb"
Shutting down instance "proddb"...
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.
Operation requires startup of instance "proddb" on database "proddb"
Starting instance "proddb"...
ORACLE instance started.
Database mounted.
Continuing to reinstate database "proddb" ...
Reinstatement of database "proddb" succeeded

Verify proddb post reinstate: The best part is broker will automatically recover earlier failed primary proddb, mount the database and start MRP too

On failed primary (proddb):
sqlplus / as sysdba
SQL> select name,open_mode from v$database;
SQL> select process, status, sequence# from v$managed_standby;

Switchover to get original configuration: At this stage, you can perform switchover to again get back original configuration

On current primary (proddb_st):
dgmgrl sys/sys@proddb_st
DGMGRL> switchover to proddb;


Recent Posts

See All
bottom of page