This topic describes how to stop an ongoing secondary backup task.
You can stop a secondary backup task during the process of secondary backup. The methods used to stop secondary backup tasks for clusters and tenants are the same.
Stop a secondary backup task by using SQL statements
Log on to the
systenant as therootuser.Stop the ongoing secondary log backup task.
If the backup is split into multiple backup pieces, execute the following statement to stop the secondary log backup task:
obclient> ALTER SYSTEM CANCEL BACKUP BACKUPPIECE;After the preceding statement is executed, you can query the
CDB_OB_BACKUP_BACKUPPIECE_JOBview to check whether the secondary log backup task is stopped.obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_BACKUPPIECE_JOB;If the query result returned by the
CDB_OB_BACKUP_BACKUPPIECE_JOBview is empty, the secondary log backup task is stopped.For more information about the fields in the
CDB_OB_BACKUP_BACKUPPIECE_JOBview, see oceanbase.CDB_OB_BACKUP_BACKUPPIECE_JOB.If the backup is not split into multiple backup pieces, execute the following statement to stop the secondary log backup task:
obclient> ALTER SYSTEM STOP BACKUP ARCHIVELOG;After the preceding statement is executed, you can query the
CDB_OB_BACKUP_BACKUP_ARCHIVELOGview to check whether the secondary log backup task is stopped.obclient> SELECT status FROM oceanbase.CDB_OB_BACKUP_BACKUP_ARCHIVELOG WHERE tenant_id=1;If the value of
statusin the query result isPAUSED, the secondary log backup task is stopped.For more information about the fields in the
CDB_OB_BACKUP_BACKUP_ARCHIVELOGview, see oceanbase.CDB_OB_BACKUP_BACKUP_ARCHIVELOG.
Execute the following statement to stop the ongoing secondary data backup task:
obclient> ALTER SYSTEM CANCEL BACKUP BACKUPSET;After the preceding statement is executed, you can query the
CDB_OB_BACKUP_BACKUPSET_JOBview to check whether the secondary data backup task is stopped.obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_BACKUPSET_JOB;If the query result is empty, the secondary data backup task is stopped.
For more information about the fields in the
CDB_OB_BACKUP_BACKUPSET_JOBview, see oceanbase.CDB_OB_BACKUP_BACKUPSET_JOB.Note
The system resumes the secondary data backup process if you initiate a secondary data backup task again.
Stop a secondary backup in OCP
Method 1: modify the backup strategy
On the Backup and Recovery page of the required cluster, move the pointer over ... in the upper-right corner and select Modify Backup Strategy to go to the Modify Backup Strategy page.
On the Modify Backup Strategy page, disable Second Backup and click Submit. After the new backup strategy takes effect, the ongoing secondary backup task is stopped.

Method 2: delete the current backup strategy
On the Backup and Recovery page of the required cluster, move the pointer over ... in the upper-right corner and select Delete Backup Strategy.
In the message that appears, click Delete.

Wait until the following message appears: The backup strategy is deleted. After the backup strategy is deleted, the ongoing secondary backup task is stopped.
More information
When you stop a secondary backup task by using SQL statements, you can attempt to forcibly stop all backup-related tasks if the secondary backup task is still running after the statements are executed. For more information, see Force stop all backup-related tasks.