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 policy set. If no user tenant is specified, all user tenants must have an automatic cleanup policy set.When a user tenant executes the
DELETE OBSOLETE BACKUPstatement, the current user tenant must have an automatic cleanup policy set.
For the SQL statement to set the automatic cleanup policy, see DELETE BACKUP POLICY.
Privilege requirements
This statement must be executed by the root user of the sys tenant (root@sys) or the administrator user of a user tenant (root user).
Syntax
ALTER SYSTEM DELETE OBSOLETE BACKUP [TENANT [=] tenant_name];
Parameters
Parameter |
Description |
|---|---|
| tenant_name | It is used by the system tenant to specify which user tenant's backup or archive will be cleaned up upon expiration. If no user tenant is specified under the system tenant, it will trigger the cleanup for all user tenants by default. |
Examples
System tenant
The system tenant triggers the cleanup of expired backups for tenant
mysql001.obclient(root@sys)[(none)]> ALTER SYSTEM DELETE OBSOLETE BACKUP TENANT mysql001;The system tenant triggers the cleanup of expired backups for all user tenants.
obclient(root@sys)[(none)]> ALTER SYSTEM DELETE OBSOLETE BACKUP;
User tenant
Triggers the expiration cleanup for backups of the current tenant.
obclient> ALTER SYSTEM DELETE OBSOLETE BACKUP;