The DELETE BACKUP ALL statement is used to clear the backup sets or log archive pieces in the specified path (data backup path or archive path).
Limitations and considerations
When using the DELETE BACKUP ALL statement to clear the backup sets or log archive pieces in the specified path:
- Only replaced backup or archive paths can be cleared. Current backup or archive paths cannot be cleared.
- The old path being cleared cannot be set as the backup or archive path again.
- After the data backup path or archive path is cleared, the corresponding path information will be deleted from the views CDB_OB_BACKUP_STORAGE_INFO(sys tenant) and DBA_OB_BACKUP_STORAGE_INFO(user tenant).
Privilege requirements
The statement must be executed by the root user of the sys tenant (root@sys) or the administrator of each tenant. Specifically:
- The default administrator in MySQL-compatible mode is the
rootuser. - The default administrator in Oracle-compatible mode is the
SYSuser.
Syntax
ALTER SYSTEM DELETE BACKUP ALL delete_backup_action [TENANT [=] tenant_name];
delete_backup_action:
DATA_BACKUP_DEST [=] 'data_backup_path'
| LOG_ARCHIVE_DEST [=] 'log_archive_path'
Parameters
| Parameter | Description |
|---|---|
| data_backup_path | Specifies the data backup path to be cleared. |
| log_archive_path | Specifies the archive path to be cleared. |
| tenant_name | Specifies the name of the user tenant for the path to be cleared. This parameter is optional and is required only when executed in the sys tenant. |
Examples
For the sys tenant
Clear the data backup path.
OSSNFSThe sys tenant clears the OSS backup path
oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.comfor the tenantmysql001.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE BACKUP ALL DATA_BACKUP_DEST ='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com' TENANT = mysql001;The sys tenant clears the NFS backup path
file:///data/nfs/backup/datafor the tenantmysql001.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE BACKUP ALL DATA_BACKUP_DEST ='file:///data/nfs/backup/data' TENANT = mysql001;Clear the archive path.
OSSNFSThe sys tenant clears the OSS archive path
oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.comfor the tenantmysql001.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE BACKUP ALL LOG_ARCHIVE_DEST ='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com' TENANT = mysql001;The sys tenant clears the NFS archive path
file:///data/nfs/backup/archivefor the tenantmysql001.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE BACKUP ALL LOG_ARCHIVE_DEST ='file:///data/nfs/backup/archive' TENANT = mysql001;
For a user tenant
Clear the data backup path.
OSSNFSThe user tenant clears the OSS backup path
oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.comfor itself.obclient> ALTER SYSTEM DELETE BACKUP ALL DATA_BACKUP_DEST ='oss://oceanbase-test-bucket/backup/data?host=****.aliyun-inc.com';The user tenant clears the NFS backup path
file:///data/nfs/backup/datafor itself.obclient> ALTER SYSTEM DELETE BACKUP ALL DATA_BACKUP_DEST ='file:///data/nfs/backup/data';Clear the archive path.
OSSNFSThe user tenant clears the OSS archive path
oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.comfor itself.obclient> ALTER SYSTEM DELETE BACKUP ALL LOG_ARCHIVE_DEST ='oss://oceanbase-test-bucket/backup/archive?host=****.aliyun-inc.com';The user tenant clears the NFS archive path
file:///data/nfs/backup/archivefor itself.obclient> ALTER SYSTEM DELETE BACKUP ALL LOG_ARCHIVE_DEST ='file:///data/nfs/backup/archive';