The DELETE OBSOLETE BACKUP statement is used to manually trigger the cleanup of expired backups.
Limitations
When the
systenant executes theDELETE OBSOLETE BACKUPstatement, if a user tenant is specified, the specified user tenant must have a cleanup strategy set. If no user tenant is specified, all user tenants must have automatic cleanup strategies set.When a user tenant executes the
DELETE OBSOLETE BACKUPstatement, the current user tenant must have an automatic cleanup strategy set.
For more information about setting an automatic cleanup strategy, see DELETE BACKUP POLICY.
Privilege requirements
The statement must be executed by the root user of the sys tenant (root@sys) or the administrator user of each tenant. Specifically:
- In MySQL mode, the default administrator user is
root. - In Oracle mode, the default administrator user is
SYS.
Syntax
ALTER SYSTEM DELETE OBSOLETE BACKUP [TENANT [=] tenant_name];
Parameters
| Parameter | Description |
|---|---|
| tenant_name | Specifies the user tenant whose expired backups or archives should be cleaned up. If not specified, all user tenants' expired backups or archives will be cleaned up by default. |
Examples
For the
systenantTrigger the cleanup of expired backups for the
mysql001tenant.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE OBSOLETE BACKUP TENANT mysql001;Trigger the cleanup of expired backups for all user tenants.
obclient(root@sys)[(none)]> ALTER SYSTEM DELETE OBSOLETE BACKUP;
For a user tenant
Trigger the cleanup of expired backups for the current tenant.
obclient> ALTER SYSTEM DELETE OBSOLETE BACKUP;
