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 you have added an Autonomous Data Guard standby database.

For switchover to a standby database, the Oracle Cloud Infrastructure Console on the primary database shows a Switchover link under Disaster recovery area 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 either local or cross-region standby database state, under Resources click Disaster recovery and for the standby database listed in the Peer Autonomous Database column, check that the State shows Standby.

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

Perform a Switchover to a Local Standby

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

To perform switchover to a local standby, you access the primary database from the Oracle Cloud Infrastructure Console.

Perform the following prerequisite steps as necessary:

  • 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 or Autonomous Transaction Processing.

  • On the Autonomous Databases page select your Autonomous Database from the links under the Display name column.

To perform a switchover:

  1. On the Autonomous Database Details page, under Disaster recovery, in the Local field, click Switchover.

    As an alternative, to initiate a switchover you can select More actions and Switchover.

  2. In the Confirm switchover to peer dialog, enter the peer database name to confirm that you want to switch over.
  3. In the Confirm switchover to peer dialog, click Confirm switchover to peer.

    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 Disaster recovery. The state State shows Role change in progress.

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

See Notes for Performing a Switchover for more information.

Perform a Switchover to a Cross-Region Standby

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

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 access the Standby database.

  • Access the primary, and from the primary database you can access the standby from the Autonomous Database Details page by selecting Disaster recovery under Resources and clicking the link for the standby database in the Peer Autonomous Database column.

To perform a switchover:

  1. On the cross-region standby database, on the Autonomous Database Details page, under Disaster recovery, in the Role field, click Switchover.

    As an alternative, to initiate a switchover you can select More actions and Switchover.

  2. In the Confirm switchover to peer dialog, enter the peer database name to confirm that you want to switch over.
  3. In the Confirm switchover to peer dialog, click Confirm switchover to peer.

    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 Disaster recovery. The state State shows Role change in progress.

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

  • The display name shows the standby indicator.

  • The Disaster recovery resource information is updated to reflect the switchover. Under Resources select Disaster recovery 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.

See Notes for Performing a Switchover for more information.

Notes for Performing a Switchover

Notes for performing a switchover on Autonomous Database.
  • 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:

    • The Oracle Cloud Infrastructure Metrics display information about the primary database.

    • The graphs on the Database Dashboard card in Database Actions display information about the primary database.

    • The graphs and metrics do not contain information about the database that was the primary database, before the switchover or failover operation.

  • 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.