Purpose
The ALTER SYSTEM CANCEL BACKUP statement is used to stop a running backup task.
Limitations and considerations
After using the ALTER SYSTEM CANCEL BACKUP statement to stop a running backup task in a tenant, the system generates some incomplete backup data. It is recommended to enable the automatic cleanup feature for the corresponding tenant in advance to clean up the incomplete backups in a timely manner and avoid resource occupation. For more information about the statement to enable the automatic cleanup feature, see DELETE BACKUP.
Privilege requirements
The root user of the sys tenant (root@sys) or the administrator user of each tenant must execute this statement. Specifically:
- The default administrator user in MySQL mode is the
rootuser. - The default administrator user in Oracle mode is the
SYSuser.
Syntax
ALTER SYSTEM CANCEL BACKUP [TENANT [=] {tenant_name[, tenant_name]...}];
Parameters
| Parameter | Description |
|---|---|
| tenant_name | Specifies the tenant name to stop the backup task. You can specify multiple tenant names separated by commas (,). If no tenant name is specified, all user tenant backup tasks are stopped.
NoticeOnly the system tenant can specify the tenant to operate on by using the |
Examples
Assume that the current cluster has three tenants: sys, mysql_tenant, and oracle_tenant. Both mysql_tenant and oracle_tenant are performing data backup tasks.
The system tenant stops the data backup tasks of 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 tasks of the
mysql_tenantandoracle_tenanttenants in the cluster.The system tenant stops the data backup task of the
mysql_tenanttenant in the cluster.obclient [oceanbase]> ALTER SYSTEM CANCEL BACKUP TENANT = mysql_tenant;The
oracle_tenanttenant stops its own data backup task.obclient [SYS]> ALTER SYSTEM CANCEL BACKUP;
