Perform a Switchover

When you perform a switchover the primary database becomes the standby database, and the standby database becomes the primary database, with no data loss.

A switchover is typically done to test failover to the standby database for audit or certification reasons, or to test your application's failover procedures when Autonomous Data Guard is enabled.

For switchover to a standby database, the Oracle Cloud Infrastructure Console on the database with the Primary role shows a Switchover link in the Role field when both the primary database and a standby database are available. You can perform a switchover when the primary database Lifecycle State shows Available or Stopped and a standby database is available (the State field shows Standby).

To see the standby database status, under Resources click Autonomous Data Guard and for the standby database listed in the Peer Autonomous Database column, check that the State field shows Standby.

Using the Autonomous Database API, you can initiate the switchover operation at any time. See Use the API for more information.

Perform the following prerequisite steps as necessary:

To perform switchover to a local standby, access the Primary database (Role: Primary) from the Oracle Cloud Infrastructure Console:

  • Open the Oracle Cloud Infrastructure Console by clicking the navigation icon next to Oracle Cloud.

  • From the Oracle Cloud Infrastructure left navigation menu click Oracle Database and then, depending on your workload click one of: Autonomous Data Warehouse, Autonomous JSON Database, or Autonomous Transaction Processing.
  • On the Autonomous Databases page select your Autonomous Database from the links under the Display Name column.

To perform switchover to a remote standby, access the Standby database (Role: Standby):

Note

For a cross-region switchover you must initiate the switchover from the Standby database.

You have several options to access the Standby database:

  • Select the remote region in Oracle Cloud Infrastructure Console and then select the Standby database.

  • Access the Primary as above, and then from the Primary database you can access the Standby from the Oracle Cloud Infrastructure Console by selecting Autonomous Data Guard under Resources and clicking the link for the standby database in the Peer Autonomous Database column.

To perform a switchover, do the following:

  1. On the Autonomous Database Details page, under Autonomous Data Guard, in the Role field, click Switchover.
    As an alternative, to initiate a switchover you can select More actions and Switchover.
  2. In the Confirm Manual Switchover to Standby dialog, enter the database name to confirm that you want to switch over.
  3. In the Confirm Manual Switchover to Standby dialog, click Confirm Manual Switchover to Standby.

    When concurrent operations such as scaling are active, the confirmation also confirms either pausing or canceling the concurrent operation. See Concurrent Operations on Autonomous Database for more information.

    The database Lifecycle State changes to Updating. To see the state of the peer database, under Resources click Autonomous Data Guard where the State column shows Role Change in Progress.

When the switchover completes, Autonomous Data Guard does the following:

  • The display name shows the Standby indicator (for a cross-region switchover).

  • The Autonomous Data Guard resource information is updated to reflect the switchover. Select Autonomous Data Guard under Resources to see the updated information.

  • Autonomous Database reports the time of the last switchover when you hover over the tooltip icon in the Role field.

Notes for Autonomous Data Guard switchover:

  • For a cross-region switchover you must initiate the switchover from the Standby database.

  • During the switchover most of the actions on the Oracle Cloud Infrastructure Console are not available and the Autonomous Database Information page shows the Lifecycle State with the value Updating.

  • The switchover operation keeps the original state of the Primary database. If the Primary database is stopped when you perform a switchover, the Primary database is stopped after the switchover.

  • Autonomous Database generates the Switchover Autonomous Database work request. To view the request, under Resources click Work Requests.

  • After a switchover or failover to the Standby, the Standby becomes the Primary and the graphs on the Database Dashboard card in Database Actions and the Oracle Cloud Infrastructure Metrics display information about the Primary database. The graphs and metrics do not contain information about the database that was the Primary before the switchover or failover operation.

  • When you enable Autonomous Data Guard with both a local and a cross-region standby, Autonomous Data Guard does not provide a local standby while the remote region instance operates in the Primary role. Using the remote region in the Primary role is intended for use while the primary region is unavailable or for testing (a temporary scenario). After the primary region database returns to the Primary role, the local Standby will be available.

  • You cannot cancel a cross-region switchover operation after the switchover begins and the State shows Role Change in Progress. Your options are:

    • Try or retry a switchover or a failover until the operation succeeds.

    • File a service request at Oracle Cloud Support or contact your support representative.