This page describes how to create a peer database for your Autonomous AI Database in Google Cloud.
For disaster recovery planning, Oracle Database@Google Cloud lets you create the following types of peer databases for your Autonomous AI Databases:
Cross-region peers: standby databases in different regions. For more information, see Protect Autonomous Databases with cross-region disaster recovery. To learn how to set up cross-region peers, see Create a peer database.
Local peers: standby databases in the same region as that of your Autonomous AI Database.
When you create an Autonomous AI Database, a local peer is automatically created. By default, its disaster recovery type is backup-based. You can change the disaster recovery type to Autonomous Data Guard. For more information, see Manage disaster recovery type for local peers.
Before you begin
- In the OCI console, ensure that you are subscribed to the region in which you want to create the peer database.
Ensure that you have the following Identity and Access Management (IAM) roles and permissions required to create a peer database:
roles/autonomousDatabaseAdmin
Create a peer database
To create a peer database, do the following:
Console
Go to the Autonomous AI Database page.
Click the name of the Autonomous AI Database for which you want to create a peer database.
On the Autonomous AI Database details page, click the Disaster Recovery tab.
In the Peer database section, click Create.
On the Add peer database page, do the following:
Select a region. The regions in which you already have peer databases don't appear in the list.
If you already have peer databases in all regions and no additional region appears in the list, then you can't create any more peer databases.
(Optional) Select the Enable cross-region backup replication to disaster recovery peer checkbox. This option enables backup replication to your peer database for up to seven days or for the selected backup retention period (if less than seven days).
From the Network project list, select the project that contains your ODB Network.
Select the ODB Network.
Select a Client subnet.
In the Advanced settings section, you can optionally modify the following settings:
- Private IP address
- Hostname prefix
Click Save.
On the Disaster recovery tab, in the Peer database section, the Status field shows you the progress of the create operation. The peer database is ready to use when the Status field shows "Standby".
gcloud
Use the gcloud oracle-database autonomous-databases create
command to create a peer database.
gcloud oracle-database autonomous-databases create PEER_DATABASE_ID \
--project=PROJECT_ID \
--location=REGION \
--odb-subnet=projects/ODB_NETWORK_PROJECT_ID/locations/REGION/odbNetworks/ODB_NETWORK_ID/odbSubnets/ODB_SUBNET_ID \
--source-config-automatic-backups-replication-enabled=ENABLE_BACKUP_REPLICATION \
--source-config-autonomous-database=projects/PROJECT_ID/locations/REGION/autonomousDatabases/PRIMARY_DATABASE_ID
Replace the following:
- PEER_DATABASE_ID: a unique identifier for your peer database.
- PROJECT_ID: the ID of your Google Cloud project.
- REGION: the region in which you want to create your peer database.
- For
odb-subnetproperty, replace the following:- ODB_NETWORK_PROJECT_ID: the ID of your Google Cloud project which contains your ODB Network. If you're using a Shared VPC, then this is the ID of your host project.
- REGION: the region of your ODB Network.
- ODB_NETWORK_ID: the ID of your ODB Network.
- ODB_SUBNET_ID: the ID of your ODB Subnet.
- ENABLE_BACKUP_REPLICATION: (Optional) enables backup replication
to your peer database for up to seven days or for the selected backup
retention period (if less than seven days). The default value is
false. - For
source-config-autonomous-databaseparameter, replace the following:- PROJECT_ID: the ID of your Google Cloud project which contains your primary database.
- REGION: the region of the primary database.
- PRIMARY_DATABASE_ID: the ID of the primary database.
API
To create a 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/PEER_DATABASE_ID"
-d \
'{
"name": "projects/PROJECT_ID/locations/REGION/autonomousDatabases/PRIMARY_DATABASE_ID",
"odb_subnet": "projects/ODB_NETWORK_PROJECT_ID/locations/REGION/odbNetworks/ODB_NETWORK_ID/odbSubnets/ODB_SUBNET_ID",
"source_config": {
"autonomous_database": "projects/PROJECT_ID/locations/REGION/autonomousDatabases/PRIMARY_DATABASE_ID",
"automatic_backups_replication_enabled": ENABLE_BACKUP_REPLICATION
}
}'
Replace the following:
- PROJECT_ID: the ID of your Google Cloud project in which to create the peer database.
- REGION: the region in which to create the peer database.
- PEER_DATABASE_ID: a unique identifier for your peer database.
- For
nameparameter, replace the following:- PROJECT_ID: the ID of your Google Cloud project which contains your primary database.
- REGION: the region of the primary database.
- PRIMARY_DATABASE_ID: the ID of the primary database.
- For
odbSubnetproperty, replace the following:- ODB_NETWORK_PROJECT_ID: the ID of your Google Cloud project which contains your ODB Network. If you're using a Shared VPC, then this is the ID of your host project.
- REGION: the region of your ODB Network.
- ODB_NETWORK_ID: the ID of your ODB Network.
- ODB_SUBNET_ID: the ID of your ODB Subnet.
- For
source_configparameter, replace the following:- PROJECT_ID: the ID of your Google Cloud project which contains your primary database.
- REGION: the region of the primary database.
- PRIMARY_DATABASE_ID: the ID of the primary database.
- ENABLE_BACKUP_REPLICATION: enables backup replication to your
peer database for up to seven days or for the selected backup retention
period (if less than seven days). The default value is
false.
When completed, you can view the new peer Autonomous AI Database in the Autonomous AI Databases list along with its details. Also, after creating a peer database in Google Cloud, you can manage and modify its network settings in the OCI console.
What's next
- View peer database details.
- Learn how to switchover to a a peer database.
- Delete a peer database.