Using the API to Manage Protected Databases
Review the list of REST API endpoints to manage protected databases.
Use the following REST API endpoints to manage protected databases.
- Create a protected database:
CreateProtectedDatabase
You can perform a dry run of the
CreateProtectedDatabase
API in order to verify that all the prerequisites are met before actually creating a protected database.See, Performing a Dry Run to Check the Preparedness for Creating a Protected Database.
- Delete a protected database:
DeleteProtectedDatabase
- View the details of a protected database:
GetProtectedDatabase
- Retrieve the protected database configuration details:
FetchProtectedDatabaseConfiguration
- Modify a protected database:
UpdateProtectedDatabase
- Change the protected database compartment:
ChangeProtectedDatabaseCompartment
- Cancel the deletion of a protected database:
CancelProtectedDatabaseDeletion
- Schedule the deletion of a protected database:
ScheduleProtectedDatabaseDeletion
Performing a Dry Run to Check the Preparedness for Creating a Protected Database
When you run the CreateProtectedDatabase
API with the opc-dry-run
option set as TRUE, it indicates that the request is a dry run to check for any missing prerequisites before creating a protected database. During a dry-run, the CreateProtectedDatabase
API returns error messages to warn you about any missing requirements, without actually creating a protected database. If an errors occurs, you can review, correct, and repeat the dry-run until the CreateProtectedDatabase
request does not return any errors.
These are the common issues that you can identify by performing a dry run of the CreateProtectedDatabase
API:
- The Recovery Service subnet has insufficient free IP addresses to support the required number of private endpoints.
Ensure that sufficient unallocated IP addresses remain available in the subnet used for Recovery Service operations in the database VCN.
- Recovery Service does not have permissions to manage the network resources in a chosen compartment.
Review and assign the required policies. See, Permissions Required for Oracle Databases in OCI to Use Recovery Service
- Recovery Service is out of capacity.
Review the service limits for your tenancy and request for an increase
- Recovery Service resources exceed quota limits
Review and manage Recovery Service resource consumption within compartments. See, Autonomous Recovery Quotas .
- A protected database, having the same database ID, already exists
Select a different database to use Recovery Service
- The specified protection policy does not exist, or it is not in an Active state
- The prerequisite of registering a Recovery Service subnet is not met
Ensure that you register a Recovery Service subnet before enabling automatic backups to Recovery Service
Example 8-1 Dry Run Request of the CreateProtectedDatabase
API
This example is a sample dry run request.
CreateProtectedDatabaseRequest createProtectedDatabaseRequest = CreateProtectedDatabaseRequest.builder() .createProtectedDatabaseDetails(createProtectedDatabaseDetails) .opcRetryToken("EXAMPLE-opcRetryToken-Value") .opcDryRun(true) .opcRequestId("UCCBPPQDHXIF5I7A11SS<unique_ID>").build();
This is a sample output of the dry run.
Status Code : 409 Service Code: IncorrectState Error Message: Authorization failed. Autonomous Recovery Service does not have the required security policies to manage virtual-network-family in the chosen compartment. See, 'Prerequisites for Using Recovery Service as a Automatic Backup Destination' in the Recovery Service documentation. The following compartment quotas were exceeded: protected-database-backup-storage-gb in policy 'example-policy' by 1. The prerequisite of registering a Recovery Service subnet is not met. Ensure that you register a Recovery Service subnet before enabling automatic backups. See, 'Register Recovery Service Subnet' in the Recovery Service documentation.
Related Topics
Parent topic: Using the API to Manage Recovery Service Resources