After a cleanup policy is successfully configured and automatic cleanup is triggered, you can view the execution progress of cleanup tasks.
View cleanup task progress in the sys tenant
Log in to the
systenant of the cluster as therootuser.Here is an example of how to connect to the database. Use the actual environment settings when you connect to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@sys#obdemo -p***** -AView the cleanup task progress.
View the job progress.
obclient(root@sys)[(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOBS\GThe query result is as follows:
*************************** 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 setAccording to the query result, the user tenant with the tenant ID
1002initiated an expired backup cleanup task at2025-09-11 12:09:53.389512. The expiration time point for the cleanup check is2022-05-31 12:09:40.060284, which indicates that the value of therecovery_windowparameter in the cleanup policy of the tenant is1d.TASK_COUNTis2, indicating that twobackup_set/backup_piecesubtasks are being executed under the JOB task. Meanwhile,SUCCESS_TASK_COUNTis1, meaning one task has been completed, so the current task completion rate is 50% (SUCCESS_TASK_COUNT/TASK_COUNT).Based on the query result, view the progress of the
backup_set/backup_piececleanup.obclient(root@sys)[(none)]> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_TASKS\GThe query result is as follows:
*************************** 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_TASK_COUNT: 2 FINISH_TASK_COUNT: 2 RESULT: 0 COMMENT: PATH: s3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com *************************** 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_TASK_COUNT: 2 FINISH_TASK_COUNT: 1 RESULT: 0 COMMENT: PATH: s3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.com 2 rows in setAccording to the query result, the user tenant with the tenant ID
1002has completed cleaning up the backup file withbackup_set_id=1in the destinations3://oceanbase-test-bucket/backup/data?host=obs.****.myhuaweicloud.com, with a task completion rate of 100% (FINISH_TASK_COUNT/TOTAL_TASK_COUNT). The backup file for log archiving withround_id=1/backup_piece_id=1in the destinations3://oceanbase-test-bucket/backup/archive?host=obs.****.myhuaweicloud.comis being cleaned up, with a task completion rate of 50% (FINISH_TASK_COUNT/TOTAL_TASK_COUNT). You can view the relevant information about the cleanup task initiation in the job-level task view usingJOB_ID.
View cleanup task progress in a user tenant
Log in to the database as a tenant administrator.
Note
The administrator user of a user tenant is the
rootuser.Here is an example of how to connect to the database. Use the actual environment settings when you connect to the database.
obclient -h10.xx.xx.xx -P2883 -uroot@mysql001#obdemo -p***** -AView the cleanup task progress.
View the job progress.
A sample query is as follows:
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BACKUP_DELETE_JOBS\GExcept for the absence of the
TENANT_IDcolumn, all columns in theDBA_OB_BACKUP_DELETE_JOBSview correspond to those in theCDB_OB_BACKUP_DELETE_JOBSview. For more information about the query result, see View cleanup task progress in the sys tenant.Based on the query result, view the progress of the
backup_set/backup_piececleanup.A sample query is as follows:
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_BACKUP_DELETE_TASKS\GExcept for the absence of the
TENANT_IDcolumn, all columns in theDBA_OB_BACKUP_DELETE_TASKSview correspond to those in theCDB_OB_BACKUP_DELETE_TASKSview. For more information about the query result, see View cleanup task progress in the sys tenant.