This section will provide you with details on how to perform a Graceful Switchover (GS). A GS is done in a controlled manner with zero data loss. During this process, the primary and standby databases switch roles.
There is a number of checks and steps to be performed as part of this process. If for some reason the process fails, it will attempt an auto-rollback depending on the stage it is at.
Unlike the previous versions, the observer or the daemon services need not be stopped/disabled before the switchover. The MultiPlatform control center would automatically take care of this
Before you execute a Graceful Switchover you must make sure that the Archive Log Gap between the primary and standby is 0 or if using Oracle RAC 0 or 1.
Before running the Graceful switchover check if there are any services running the database if so you might have to set the value of the DDC variable SERVICE_USED and SERVICE_USED_DR to Y. Check the usage of the variable in the below documentation link.
If RMAN is used in no-catalog mode on primary or standby database, execution of Graceful Switchover will render any backup information and setting in primary and standby controlfiles unusable. After Graceful switchover, crosscheck and catalog of existing backups must be performed.
Guaranteed Restore points if created in the primary should be dropped before GS is initiated since GS would fail and will not proceed unless the restore point in dropped.
2. Example of Graceful Switchover.
Oracle Linux Server release 7.7
In the below example, by clicking on the configuration ( 1 ), you can see that the Primary server tahi is online ( 2 ) and the standby database is in server rua and its in recovering status ( 3 ) i.e the archivelogs are getting transferred from tahi and applied in standby rua. The automatic standby update is enabled and the observer is also enabled and watching the configuration ( 4 ). When you click the configuration ( 1 ), the available options and operations that can be performed on the configuration are displayed and the next step is to click on the Graceful Switchover ( 5 ) option to proceed further.
2.1 Switchover Pre-check
The next step will display the log gap report between standby and primary ( 1 ). The log gap has to be zero for single instance and for RAC it can be zero for one instance and one for the other. If the log gap is zero then it would be safe to proceed with the graceful switchover ( 2 ). The process can be started easily by clicking on the start button ( 3 ) or exited by clicking on the close button ( 4 ).
If the log gap is greater than zero then an error is shown like below and the process stops and this cannot proceed until all the archivedlogs have been applied in standby and the gap is shown as zero like above ( 1 ).
2.2 Switchover progress
After submitting the switchover process by clicking the start button. The progress can be seen on the right corner along with configuration details ( 1 ). The entire progress can be seen by clicking on task ( 1 ) and the main steps for the graceful switchover are shown on the left tab ( 2 ) and the detailed progress is shown on the right side. The automatic standby update option and observer are automatically disabled during the switchover process ( 3 ). The detailed start and end time are also shown on the window ( 4 ).
Once the switchover process completes, the tasks are updated ( 1 ). The roles are reversed, along with observer and automatic standby update enabled ( 2 ). The entire duration of the switchover process is also recorded ( 3 ).
2.3 Configuration Changes
After the switchover completes, the database configuration changes as the roles are swapped between primary and standby. The below figure shows that the configuration name is unchanged ( 1 ), but the Primary is changed to rua ( 2 ) and the standby is changed to tahi ( 3 ). The observer and the automatic standby update are enabled ( 4 ).