Step 1 Verify that the primary database can be switched to the standby role.
Verify that the master database can switch to the slave role.
SELECT SWITCHOVER_STATUS from v $ DATABASE;
Idle>: wq
SWITCHOVER_STATUS
--------------------
TO STANDBY
Step 2 Initiate the switchover on the primary database.
Switch over the master database
Alter database commit to switchover to physical standby with session shutdown;
Step 3 Shut down and then mount the former primary database.
Close and mount the previous master database.
Shutdown abort;
Startup mount;
Step 4 Verify that the switchover target is ready to be switched to the primary role.
Verify that the conversion target is ready to be converted to the master database role
SWITCHOVER_STATUS
--------------------
SWITCHOVER LATENT
The value queried here is not TO_PRIMARY.
Problems may occur during the next step.
Step 5 Switch the target physical standby database role to the primary role.
Convert the target logical standby database role to the master database role.
Sys @ DEX> alter database commit to switchover to primary with session shutdown;
ALTER DATABASE COMMIT TO SWITCHOVER TO PRIMARY WITH SESSION SHUTDOWN
*
ERROR at line 1:
ORA-16139: media recovery required
Media recovery is required.
Sys @ DEX> alter database recover managed standby database disconnect from session;
Database altered.
Sys @ DEX> SELECT SWITCHOVER_STATUS from v $ DATABASE;
SWITCHOVER_STATUS
--------------------
TO PRIMARY
Sys @ DEX> alter database commit to switchover to primary with session shutdown;
Database altered.
Step 6 Open the new primary database.
Open a new master database
Sys @ DEX> alter database open;
Database altered.
Step 7 Verify the switch role.
Verify role conversion
Master database execution
Sys @ DEX> alter system switch logfile;
System altered.
Sys @ DEX> select sequence # from v $ log;
SEQUENCE #
----------
40
41
42
Sys @ DEX>
Standby database execution
Sys @ DEX> select sequence # from v $ log;
SEQUENCE #
----------
40
42
41
Sys @ DEX>