Toad World Blog: Switchover and Switchback Simplied in Oracle 12c
Toad World Blog: Switchover and Switchback Simplied in Oracle 12c
Toad World Blog: Switchover and Switchback Simplied in Oracle 12c
Tweet
Share Like 0 Share
Business continuity (Disaster Recovery) has become a very critical factor for every business, especially in the nancial sectors. Most of
the banks are tending to have their regular DR test to meet the central bank regulation on DR testing capabilities.
Very recently, there was a request from one of the clients to perform a reverse replication and rollback (i.,e switchover & switchback)
between the HO and DR for one of the business critical databases. Similar activities performed with easy on pre 12c databases.
However, this was my rst experience with Oracle 12c. After spending a bit of time to explore whats new in 12c Switchover, it was
amazing to learn how 12c simpli ed the procedure. So, I decided to write a post on my experience.
This post demonstrates how Switchover and Switchback procedure is simpli ed in Oracle 12c.
-- Primary
-- Standby
Before getting into the real action, validate the following to avoid any failures during the course of role transition:
https://blog.toadworld.com/2017/10/13/switchover-and-switchback-simplied-in-oracle-12c 1/5
11/30/2019 Switchover and Switchback simplied in Oracle 12c
For a smooth role transition, it is important to have everything in-place and in sync. Pre-Oracle 12c, a set of commands used on
PRIMARY and STANDBY to validate the readiness of the systems. However, with Oracle 12c, this is simpli ed with the ALTER DATABASE
SWITCHOVER VERIFY command. The command performs the following set of actions:
Let’s run the command on the primary database to validate if the environments are ready for the role transition.
When the command is executed, an ORA-16475 error was encountered. For more details, lets walk through the PRIMARY and
STANDBY databases alert.log le, and pay attention to the SWITCHOVER VERIFY WARNING.
The LOG_ARCHIVE_DEST_2 parameter was not set on the STANDBY database and the VERIFY command produced the warning. After
setting the parameter on the STANDBY, the verify command was re-ran, and it went well this time.
Switchover in 12c
After successful validation and con rmation about the DBs readiness for the role transition, execute the actual switchover command
on the primary database. (advised to view the alert.log les of PRIMARY and STANDBY instances).
Database altered.
Let’s walk through the PRIMARY and STANDBY database alert.log les to review what Oracle has internally done.
BACK TO TOP
https://blog.toadworld.com/2017/10/13/switchover-and-switchback-simplied-in-oracle-12c 2/5
11/30/2019 Switchover and Switchback simplied in Oracle 12c
BACK TO TOP
https://blog.toadworld.com/2017/10/13/switchover-and-switchback-simplied-in-oracle-12c 3/5
11/30/2019 Switchover and Switchback simplied in Oracle 12c
SWITCHOVER: received request 'ALTER DTABASE COMMIT TO SWITCHOVER TO PRIMARY' from primary database.
At this point-in-time, the new PRIMARY database is in MOUNT state, so you need to OPEN the database.
And startup the STANDBY database and enable MRP: (below is the active standby database command)
IMMPRD> startup
IMMPRD> recover managed standby database using current logfile disconnect from session;
On Standby database
You can also enable the trace on primary and standby before performing the role transition to analyze any failures during the
procedure. Use the below procedure on the PRIMARY database to enable the tracing:
Switchback
To revert (switch back) to the previous situation, perform the same action. Remember, now, your primary is your previous STANDBY
and standby is previous PRIMARY. References:
12c Data guard Switchover Best Practices using SQLPLUS (Doc ID 1578787.1)
Tags: Oracle
BACK TO TOP
https://blog.toadworld.com/2017/10/13/switchover-and-switchback-simplied-in-oracle-12c 4/5