After a cleanup strategy is configured and automatic cleanup is triggered, expired backup data is automatically cleaned up based on the strategy. You can query the execution progress of cleanup tasks.
View the cleanup progress as the sys tenant
Log in to the
systenant of the cluster as therootuser.The following example shows how to connect to the database. Replace the actual environment variables with the values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AView the progress of cleanup tasks.
View the progress of job-level cleanup tasks.
obclient(root@sys)[(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOBS\GExample result:
*************************** 1. row *************************** TENANT_ID: 1002 JOB_ID: 7 INCARNATION: 1 INITIATOR_TENANT_ID: 1002 INITIATOR_JOB_ID: 7 EXECUTOR_TENANT_ID: 1002 TYPE: DELETE OBSOLETE BACKUP PARAMETER: expired_time:2025-09-10 12:09:40.060284 JOB_LEVEL: USER_TENANT START_TIMESTAMP: 2025-09-11 12:09:53.389512 END_TIMESTAMP: STATUS: DOING TASK_COUNT: 2 SUCCESS_TASK_COUNT: 1 RESULT: 0 COMMENT: 1 row in setFrom the query result, you can see that a user tenant with the tenant ID
1002initiated a cleanup job for expired backups at2025-09-11 12:09:53.389512. The expiration time of the backups is2025-09-10 12:09:40.060284, which indicates that the value of therecovery_windowparameter in the cleanup policy of this tenant is1d.TASK_COUNTis2, indicating that twobackup_set/backup_piecesubtasks are being executed under this job.SUCCESS_TASK_COUNTis1, indicating that one subtask has been completed. Therefore, the current completion rate of the job is 50%, which is calculated by the following formula:SUCCESS_TASK_COUNT/TASK_COUNT.View the progress of
backup_set/backup_piececleanup tasks.obclient(root@sys)[(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_TASKS\GExample result:
*************************** 1. row *************************** TENANT_ID: 1002 TASK_ID: 4 INCARNATION: 1 JOB_ID: 7 TASK_TYPE: BACKUP SET ID: 1 ROUND_ID: 0 DEST_ID: 1002 START_TIMESTAMP: 2025-09-11 12:09:50.800772 END_TIMESTAMP: 2025-09-11 12:09:54.954691 STATUS: COMPLETED TOTAL_LS_COUNT: 2 FINISH_LS_COUNT: 2 RESULT: 0 COMMENT: PATH: file:///data/nfs/backup/data *************************** 2. row *************************** TENANT_ID: 1002 TASK_ID: 5 INCARNATION: 1 JOB_ID: 7 TASK_TYPE: BACKUP PIECE ID: 1 ROUND_ID: 1 DEST_ID: 1001 START_TIMESTAMP: 2025-09-11 12:09:50.968413 END_TIMESTAMP: STATUS: DOING TOTAL_LS_COUNT: 2 FINISH_LS_COUNT: 1 RESULT: 0 COMMENT: PATH: file:///data/nfs/backup/archive 2 rows in setFrom the query result, you can see that for the user tenant with the tenant ID
1002, the backup file of the data backup withbackup_set_id=1in the destinationfile:///data/nfs/backup/datahas been cleaned up, and the completion rate of this task is 100%, which is calculated by the following formula:FINISH_LS_COUNT/TOTAL_LS_COUNT. In the destinationfile:///data/nfs/backup/archive, the backup file of archive logs withround_id=1/backup_piece_id=1is being cleaned up, and the completion rate of this task is 50%. You can query the information about the initiation of the cleanup tasks in the job-level view based onJOB_ID.
View the cleanup progress as a user tenant
Log in to the database as the administrator of the user tenant.
Note
The administrator of a MySQL-compatible tenant is the
rootuser. The administrator of an Oracle-compatible tenant is theSYSuser.The following example shows how to connect to the database. Replace the actual environment variables with the values in your environment.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql001#obdemo -p***** -AView the progress of cleanup tasks.
View the progress of job-level cleanup tasks.
MySQL-compatible modeOracle-compatible modeExample in MySQL-compatible mode:
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BACKUP_DELETE_JOBS\GExample in Oracle-compatible mode:
obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BACKUP_DELETE_JOBS\GThe
DBA_OB_BACKUP_DELETE_JOBSview contains all the fields of theCDB_OB_BACKUP_DELETE_JOBSview except theTENANT_IDfield. For more information about the query result, see View the cleanup progress as the sys tenant.View the progress of
backup_set/backup_piececleanup tasks.MySQL-compatible modeOracle-compatible modeExample in MySQL-compatible mode:
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BACKUP_DELETE_TASKS\GExample in Oracle-compatible mode:
obclient(SYS@oracle001)[SYS]> SELECT * FROM SYS.DBA_OB_BACKUP_DELETE_TASKS\GThe
DBA_OB_BACKUP_DELETE_TASKSview contains all the fields of theCDB_OB_BACKUP_DELETE_TASKSview except theTENANT_IDfield. For more information about the query result, see View the cleanup progress as the sys tenant.