Time for action – switchover with a physical standby using SQL*Plus
Perform the following steps using the SQL*Plus connection for both the databases:
We have to check whether the primary database is ready for switchover to standby or not. Check the switchover status from the primary database by issuing the following command and verify that the status is either
TO STANDBY
orSESSIONS ACTIVE
:SQL> select switchover_status from v$database; SWITCHOVER_STATUS -------------------- TO STANDBY
The previous output shows that the primary database is ready to switch to the standby database role. The
SESSIONS ACTIVE
status indicates that some user sessions are still connected to the database. Such a case does not pose an obstacle for switchover. When output isSESSIONS ACTIVE
, you have to perform switchover using the keywordWITH SESSION SHUTDOWN
. This is so that those sessions will be terminated during the switchover.Perform the switchover command from the primary database.
SQL> alter database commit...