Purpose
The ALTER SYSTEM CANCEL BACKUP statement is used to stop a running backup task.
Limitations and considerations
After you use the ALTER SYSTEM CANCEL BACKUP statement to stop a backup task running in a tenant, the system generates some incomplete backup data. It is recommended that you enable the automatic cleanup of backups for the corresponding tenant in advance to promptly clean up incomplete backups and avoid resource consumption. For the statement to enable automatic cleanup of backups, 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 CANCEL BACKUP [TENANT [=] {tenant_name[, tenant_name]...}];
Parameters
Parameter |
Description |
|---|---|
| tenant_name | The system tenant specifies the tenant name for which to stop the backup task. Multiple tenant names can be specified, separated by commas (,). If the system tenant does not specify a tenant, it means stopping backup tasks for all user tenants.
NoteOnly the system tenant can execute this command with the |
Examples
Assume that the current cluster has two tenants, namely sys and mysql_tenant, and that tenant mysql_tenant has a data backup task in progress.
The system tenant stops the data backup tasks for all tenants in the cluster.
obclient [oceanbase]> ALTER SYSTEM CANCEL BACKUP;In this example, after the statement is executed, the system stops the data backup task for the
mysql_tenanttenant in the cluster.Stop the data backup task for tenant
mysql_tenantin the cluster from the system tenant.obclient [oceanbase]> ALTER SYSTEM CANCEL BACKUP TENANT = mysql_tenant;Stop the data backup task for the
mysql_tenanttenant.obclient [SYS]> ALTER SYSTEM CANCEL BACKUP;