Skip to main content

backups

Creates, updates, deletes, gets or lists a backups resource.

Overview​

Namebackups
TypeResource
Idoci.database.backups

Fields​

The following fields are returned by SELECT queries:

The database backup information was retrieved.

NameDatatypeDescription
idstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the backup.
availabilityDomainstringThe name of the availability domain where the database backup is stored.
backupDestinationTypestringType of the backup destination. (OBJECT_STORE, DBRS, AWS)
compartmentIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the compartment.
databaseEditionstringThe Oracle Database Edition that applies to all the databases on the DB system. Exadata DB systems and 2-node RAC DB systems require ENTERPRISE_EDITION_EXTREME_PERFORMANCE. (STANDARD_EDITION, ENTERPRISE_EDITION, ENTERPRISE_EDITION_HIGH_PERFORMANCE, ENTERPRISE_EDITION_EXTREME_PERFORMANCE, ENTERPRISE_EDITION_DEVELOPER)
databaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the database.
databaseSizeInGBsnumber (double)The size of the database in gigabytes at the time the backup was taken.
displayNamestringThe user-friendly name for the backup. The name does not have to be unique.
encryptionKeyLocationDetailsobjectTypes of providers supported for managing database encryption keys
isUsingOracleManagedKeysbooleanTrue if Oracle Managed Keys is required for restore of the backup.
kmsKeyIdstringThe OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations.
kmsKeyVersionIdstringThe OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. If none is specified, the current key version (latest) of the Key Id is used for the operation. Autonomous AI Database Serverless does not use key versions, hence is not applicable for Autonomous AI Database Serverless instances.
lifecycleDetailsstringAdditional information about the current lifecycle state.
lifecycleStatestringThe current state of the backup. (CREATING, ACTIVE, DELETING, DELETED, FAILED, RESTORING, UPDATING)
retentionPeriodInDaysintegerThe retention period of the long term backup in days.
retentionPeriodInYearsintegerThe retention period of the long term backup in years.
secondaryKmsKeyIdsarrayList of OCIDs of the key containers used as the secondary encryption key in database transparent data encryption (TDE) operations.
shapestringShape of the backup's source database.
timeEndedstring (date-time)The date and time the backup was completed.
timeExpiryScheduledstring (date-time)Expiration time of the long term database backup.
timeStartedstring (date-time)The date and time the backup started.
typestringThe type of backup. (INCREMENTAL, FULL, VIRTUAL_FULL)
vaultIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the Oracle Cloud Infrastructure [vault](/Content/KeyManagement/Concepts/keyoverview.htm#concepts). This parameter and secretId are required for Customer Managed Keys.
versionstringVersion of the backup's source database

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbackupId, regionGets information about the specified backup.
listselectregiondatabaseId, compartmentId, limit, page, shapeFamily, version, type, lifecycleState, timeExpiryScheduledGreaterThanOrEqualTo, timeExpiryScheduledLessThan, backupDestinationTypeGets a list of backups based on the databaseId or compartmentId specified. Either one of these query parameters must be provided.<br />
createinsertregion, databaseId, displayNameopc-retry-tokenCreates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work.<br />
updateupdatebackupId, regionif-match, opc-request-idUpdates database backup details.
deletedeletebackupId, regionif-matchDeletes a full backup. You cannot delete automatic backups using this API.

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
backupIdstringThe backup [OCID](/Content/General/Concepts/identifiers.htm).
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
backupDestinationTypestringA filter to return only resources that match the given backup destination type.
compartmentIdstringThe compartment [OCID](/Content/General/Concepts/identifiers.htm).
databaseIdstringThe [OCID](/Content/General/Concepts/identifiers.htm) of the database.
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
lifecycleStatestringA filter to return only resources that match the given lifecycle state exactly.
limitintegerThe maximum number of items to return per page.
opc-request-idstringUnique identifier for the request.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringThe pagination token to continue listing from.
shapeFamilystringIf provided, filters the results to the set of database versions which are supported for the given shape family.
timeExpiryScheduledGreaterThanOrEqualTostring (date-time)The start of date-time range of expiration for the long term backups to be fetched.
timeExpiryScheduledLessThanstring (date-time)The end of date-time range of expiration for the long term backups to be fetched.
typestringA filter to return only backups that matches with the given type of Backup.
versionstringA filter to return only resources that match the given database version.

SELECT examples​

Gets information about the specified backup.

SELECT
id,
availabilityDomain,
backupDestinationType,
compartmentId,
databaseEdition,
databaseId,
databaseSizeInGBs,
displayName,
encryptionKeyLocationDetails,
isUsingOracleManagedKeys,
kmsKeyId,
kmsKeyVersionId,
lifecycleDetails,
lifecycleState,
retentionPeriodInDays,
retentionPeriodInYears,
secondaryKmsKeyIds,
shape,
timeEnded,
timeExpiryScheduled,
timeStarted,
type,
vaultId,
version
FROM oci.database.backups
WHERE backupId = '{{ backupId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples​

Creates a new backup in the specified database based on the request parameters you provide. If you previously used RMAN or dbcli to configure backups and then you switch to using the Console or the API for backups, a new backup configuration is created and associated with your database. This means that you can no longer rely on your previously configured unmanaged backups to work.<br />

INSERT INTO oci.database.backups (
databaseId,
displayName,
retentionPeriodInDays,
retentionPeriodInYears,
region,
opc-retry-token
)
SELECT
'{{ databaseId }}' /* required */,
'{{ displayName }}' /* required */,
{{ retentionPeriodInDays }},
{{ retentionPeriodInYears }},
'{{ region }}',
'{{ opc-retry-token }}'
RETURNING
id,
availabilityDomain,
backupDestinationType,
compartmentId,
databaseEdition,
databaseId,
databaseSizeInGBs,
displayName,
encryptionKeyLocationDetails,
isUsingOracleManagedKeys,
kmsKeyId,
kmsKeyVersionId,
lifecycleDetails,
lifecycleState,
retentionPeriodInDays,
retentionPeriodInYears,
secondaryKmsKeyIds,
shape,
timeEnded,
timeExpiryScheduled,
timeStarted,
type,
vaultId,
version
;

UPDATE examples​

Updates database backup details.

UPDATE oci.database.backups
SET
retentionPeriodInDays = {{ retentionPeriodInDays }},
retentionPeriodInYears = {{ retentionPeriodInYears }}
WHERE
backupId = '{{ backupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
availabilityDomain,
backupDestinationType,
compartmentId,
databaseEdition,
databaseId,
databaseSizeInGBs,
displayName,
encryptionKeyLocationDetails,
isUsingOracleManagedKeys,
kmsKeyId,
kmsKeyVersionId,
lifecycleDetails,
lifecycleState,
retentionPeriodInDays,
retentionPeriodInYears,
secondaryKmsKeyIds,
shape,
timeEnded,
timeExpiryScheduled,
timeStarted,
type,
vaultId,
version;

DELETE examples​

Deletes a full backup. You cannot delete automatic backups using this API.

DELETE FROM oci.database.backups
WHERE backupId = '{{ backupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
;