This topic describes how to stop an ongoing secondary backup clearing task.
Stop manual clearing
The methods that you can use to stop manual secondary backup clearing for clusters and tenants are the same.
Log on to the
systenant as therootuser.Execute the following statement to stop the ongoing clearing task:
obclient> ALTER SYSTEM CANCEL DELETE BACKUP;
Stop automatic clearing
Before you stop an automatic secondary backup clearing task, disable automatic secondary backup clearing so that the task will not be scheduled again.
Note
Automatic secondary backup clearing can be implemented only at the cluster level.
Log on to the
systenant as therootuser.Disable automatic secondary backup clearing.
If you have enabled automatic secondary backup clearing by setting the
backup_backup_dest_optionparameter, change the value ofauto_delete_obsolete_backupinbackup_backup_dest_optiontoFalse. For more information about theauto_delete_obsolete_backupparameter inbackup_backup_dest_option, see Preparations for secondary backup.If you have enabled automatic secondary backup clearing by setting the
auto_delete_expired_backupparameter for your cluster, change the value of the parameter toFalse.Execute the following statement to stop the ongoing clearing task:
obclient> ALTER SYSTEM CANCEL DELETE BACKUP;
Verify whether a clearing task has been stopped
After the statement to stop the clearing task is executed, you can query the __all_virtual_backup_clean_info table to check whether the clearing task is stopped.
Log on to the
systenant as therootuser.Execute the following statement to check whether the clearing task is stopped:
obclient> SELECT tenant_id,status FROM oceanbase.__all_virtual_backup_clean_info; +-----------+--------+ | tenant_id | status | +-----------+--------+ | 1 | STOP | | 1001 | STOP | | 1002 | STOP | +-----------+--------+ 3 rows in setIf the value of
statusisSTOP, the task is stopped.
More information
When you stop a secondary backup clearing task, you can attempt to force stop all backup-related tasks if the secondary backup clearing task is still running after the ALTER SYSTEM CANCEL DELETE BACKUP statement is executed. For more information, see Force stop all backup-related tasks.