This page describes how to perform a switchover to a peer Autonomous AI Database in Google Cloud. You can perform a switchover through both Google Cloud and OCI.
If the Primary Autonomous AI Database is down, you can perform a switchover from the peer (Standby) database.
Before you begin
Ensure that you have the following roles and permissions required to perform a switchover:
roles/autonomousDatabaseAdmin
Perform a Switchover
To switchover to a peer database, do the following:
Console
Go to the Autonomous AI Database page.
Click the name of the primary Autonomous AI Database on which you want to perform a switchover operation.
On the Autonomous AI Database details page, click the Disaster Recovery tab.
In the Peer database section, for the peer database that you want to switchover to, click View actions, and then click Switchover.
In the Confirm switchover to peer dialog, do the following:
- If your primary database is not automatically detected, select the region of your primary database.
- Enter the ID of your peer database.
- Click Confirm.
On the Disaster recovery tab, in the Peer database section, the Status field shows you the progress of the switchover operation. After the switchover is complete, the peer database becomes the "Primary" and its Status field shows "Available". Whereas, the former Primary Autonomous AI Database becomes the "Standby".
If you initiated the switchover in the OCI console, you can still see the progress of the switchover in the Google Cloud console.
gcloud
To perform a switchover to a cross-region peer, run the gcloud oracle-database autonomous-databases switchover
command.
gcloud oracle-database autonomous-databases switchover DATABASE_ID
--project=PROJECT_ID
--location=REGION
--peer-autonomous-database=projects/PROJECT_ID/locations/REGION/autonomousDatabases/PEER_DATABASE_ID
Replace the following:
- DATABASE_ID: the ID of your database
- PROJECT_ID: the ID of your Google Cloud project
- REGION: the region where your database is located
- PEER_DATABASE_ID: the ID of your peer database
To perform a controlled switchover to a local standby peer database, run the following command:
gcloud oracle-database autonomous-databases switchover DATABASE_ID
--project=PROJECT_ID
--location=REGION
Replace the following:
- DATABASE_ID: the ID of your database
- PROJECT_ID: the ID of your Google Cloud project
- REGION: the region where your database is located
API
To perform a switchover to a cross-region peer, run the following curl
command:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/autonomousDatabases/DATABASE_ID:switchover" \
-d \
'{
"peerAutonomousDatabase": "projects/PROJECT_ID/locations/REGION/autonomousDatabases/PEER_DATABASE_ID"
}'
Replace the following:
- PROJECT_ID: the ID of your Google Cloud project
- REGION: the region where your database is located
- DATABASE_ID: the ID of your database
- PEER_DATABASE_ID: the ID of your peer database
To perform a controlled switchover to a local standby peer database, run the
following curl command:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://oracledatabase.googleapis.com/v1/projects/PROJECT_ID/locations/REGION/autonomousDatabases/DATABASE_ID:switchover"
Replace the following:
- PROJECT_ID: the ID of your Google Cloud project
- REGION: the region where your database is located
- DATABASE_ID: the ID of your database