Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Align

Graceful Switchover (GS) is also referred to as role reversal or switchover. It is not the same as failover.
Graceful Switchover is used to switch back to the original primary database after a disaster in which the standby database has been activated. 
Graceful Switchover may also be used for planned outages to perform an upgrade on the primary site by switching over the database users to the standby site as hardware or software is upgraded on the primary site. It may also be used to test the Disaster Recovery scenario.
Graceful Switchover can be used on single and RAC databases. It can be used when the redo logs or the archive logs are in regular file system or Oracle ASM file system. 
During a switchover, the primary database transitions to a standby role, and the standby database transitions to the primary role. There is no loss of data during the transition and the standby database does not have to be rebuilt. 
After the planned outage is completed, Graceful Switchover can reverse back to the original state.

Note 1: Always ensure you have a valid backup before initiating Graceful Switchover.
Note 2: Graceful Switchover has been carefully designed so that if it fails for any reason, there will always be a rollback or roll forward path to ensure you are not left with two primary databases or two standby databases.
Note 3: Graceful Switchover supports different structures between the primary and standby database. The standby database files or redo logs may be in different directory structure (mount points) as the primary database and have different file names. The standby database must however have the same number of data files as the primary database. 
Note 4: Graceful Switchover can be initiated throught through the web interface (GUI) or through the command line (CLI). There is no difference in functionality, however because of the nature of web interfaces using an asynchronous connection, it is recommend to use the command line (CLI) interface when initiating Graceful Switchover in production environments. Through the web interface there is a small possibility of loosing the connection from the web browser to the webserver. In this case the graceful switchover process will continue to function in the background but the output will no longer be displayed in the browser windows. The output can always be seen in the Dbvisit Standby logs on both the primary and standby servers. 
 

Graceful Switchover overview:

  • Allows planned role reversal between the primary database and one of its standby databases. The primary database transitions to a standby role, and the standby database transitions to the primary role.
  • Is to handle scheduled outages on the primary system without the loss of service.
  • Has been tested on Oracle 8i, 9i, 10g and 11g.
  • Databases will be shutdown temporarily during the transition phase.
  • Temporary data files will be added to the new primary database.
  • Allows only a small interruption of service as users can continue operations on standby database during outage on primary database.
  • Can reverse back to the original state once scheduled maintenance is completed.
  • There is no data loss during the transition.
  • Primary Database online redo logs must be available.
  • It is recommended to test the Graceful Switchover on a test system with similar bandwidth and latency between the primary and standby server as the production systems.
  • The time taken for the switchover to complete depends on the size of the redo logs, the archive logs and the speed of the network between the primary and the standby server.
  • It can be used for normal file system database and ASM file system databases.

...

In some cases, on Windows the registry setting ORA_DB _{}AUTOSTART needs to be set to FALSE. (where DB is the name of your database) The setting is in: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE. (Only set this if graceful switchover is not successful initially).

If the database uses ASM, then the ASM instance must be at least Oracle version 11.1. This limitation is only for the ASM instance and not for the database itself.

How the Dbvisit Standby Graceful Switchover process works

...

*Depending on speed of network and distance between primary and standby server.

 

Please also see: 

 

When running Graceful Switchover in a RAC environment

Graceful Switchover (GS) is fully supported in an Oracle RAC environment.

Dbvisit Standby will be run from the primary nodes shipping logs to the standby server.  When the GS process is running, you will execute the GS command from one of the Primary RAC nodes and also on the standby server.

As with the Single Instance GS process, the same unique key must be used on both primary and standby.

It is recommended to always run a log gap report prior to running the GS process so that you can ensure that the Archive Log Gap between the primary and standby is 0 - BUT when using RAC the Archive Log gap can be 1 on one of the RAC threads (this is as you will not always be able to get a 0 archive log gap for all threads.

Perform Graceful Switchover using either GUI or CLI.  If using the GUI - from the Run Interactive Screen select the Database (DDC) and then the Graceful Switchover option in drop down, provide a Unique key and click on next.  If using the CLI - run the command: ./dbv_oraStartStop switchover DDC <unique_key>

Note: you still have to run the switchover step on both the primary node (only one of them) and the standby node using the same unique key.

 

At the end of the Graceful Switchover where the Oracle RAC environment become the primary again, there will be a message showing you that you can enable the RAC database (all nodes by doing following).

This final step needs to be executed by the Database Administrator as the reason for the GS might have been to add RAC nodes or remove nodes etc.  


1.  Update the cluster_database=true in spfile
2.  Update the cluster_database_instances=X in the spfile - where X is the number of instances you have configured for this RAC database.
3.  Shutdown the instance, then start the Cluster database using the "srvctl" command - srvctl start database -d DB_UNIQUE_NAME