Using the API to Manage Protected Databases

Review the list of REST API endpoints to manage protected databases.

For information about using the API and signing requests, see REST APIs and Security Credentials. For information about SDKs, see Software Development Kits and Command Line Interface

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.

    See, Register Recovery Service Subnets

  • Recovery Service does not have permissions to manage the network resources in a chosen compartment.

    Review and assign the required policies. See, Policies to Enable Access to Recovery Service and Related Resources

  • Recovery Service is out of capacity.

    Review the service limits for your tenancy and request for an increase

    See, Autonomous Recovery Service Limits

  • 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

    See, Managing Protection Policies

  • 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

    See, Register Recovery Service Subnets

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.
Ensure that you review and perform all the prerequisite tasks described in Configuring your Tenancy for Recovery Service.