Purpose
You can use this statement to delete backup sets.
This statement can be executed only in the sys tenant.
Syntax
ALTER SYSTEM DELETE BACKUPSET backup_set_id [COPY copy_id];
Note
When you execute the DELETE BACKUPSET statement to clear backup sets, the following limits apply:
- If the
backup_destof thebackup_set_idto be deleted is the same as the destination specified in thebackup_destconfiguration item, at least one complete and valid backup copy is retained.Otherwise, the constraint of retaining one valid backup copy does not apply. - If the
backup_destof thebackup_set_idto be deleted is the same as the destination specified in thebackup_destconfiguration item, thebackup sets must be deleted in a specific order. For example,backup sets withbackup_set_idof 1, 2, and 3 must be deleted in the order of 1 first, followed by 2, and 3 last. Otherwise, the constraint on the deletion order of backup setsdoesnotapply. - The statement fails if the specified
backup_set_iddoes not exist, or the backup of the specifiedbackup_set_idis still ongoing.
Parameters
| Parameter | Description |
|---|---|
| backup_set_id | The ID of thebackup set corresponding to the backup to be cleared. An ID is generated when a backup is initiated. The ID can be queried in the CDB_OB_BACKUP_SET_DETAILS view. Note: The BS_KEY field in the CDB_OB_BACKUP_SET_DETAILS view corresponds to backup_set_id. |
| copy_id | To clear the specified secondary backup, you need to specify copy_id, which indicates the data backup with specified <backup_set_id, copy_id>. You can find copy_id in the CDB_OB_BACKUP_SET_DETAILS view. |
Examples
View the backup operations that have been performed.
obclient> SELECT * FROM CDB_OB_BACKUP_SET_DETAILS;Clear the backups whose
backup_set_idandcopy_idare both1.obclient> ALTER SYSTEM DELETE BACKUPSET 1 COPY 1;
Note
If the error code 9044 is reported, the data clearing task is ongoing and you are not allowed to initiate another clearing task.