Oracle 12c DataGuard Switchover and Switchback

Share via:

Oracle 12c DataGuard Switchover  and Switchback

Please check my previous article on Active standby database.

How to build ACTIVE STANDBY DATABASE using RMAN DUPLICATE command in 12c.(Video included)

After configuring data guard, databases would be either primary and standby database role, and we can altered these roles without loss of data or without resetting logs. called switchover and switch back.

Switch-over :

Before performing switch over, kindly verify the state of data guard on both the instances by following SQL queries:

Note: This command will give you appropriate message about the data guard current status.

After getting confirmation on data guard smooth activity, we can instantiate switchover activity by issuing following sort of commands:

On Primary database:

Step 1 :
Connect to Primary database and convert primary database to standby.

Step 2 :
Shutdown primary database:

Step 3 :

Startup nomount old primary database as new standby database:

Verify database role on old primary database:


On Standby database:

Step 4 :
On original standby database, Convert old standby database to primary database:

Step 5 :

Convert old standby database as primary and shutdown database:

Step 6 :

Startup old standby database as primary database:

Verify database role on old standby database:

Switch over activity have completed successfully, our old primary database has become standby and old standby database has become primary database.


To test above switchover activity, generate multiple archive logs on primary database and verify those archive logs being transferred on standby database.


To switchback, you have to follow same above mentioned 6 steps.

Just Try it.


Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)

Add Comment