After a cleanup strategy is configured and automatic cleanup is triggered, expired backup data will be automatically cleaned up based on the strategy. You can query the backup cleanup progress.
Query views for the backup cleanup progress
Log on to the database as an administrator of the sys tenant or a user tenant.
Query the backup cleanup progress.
Query the progress of backup cleanup jobs.
You can query the
oceanbase.CDB_OB_BACKUP_DELETE_JOBSview from the sys tenant for the progress of the cleanup jobs of all tenants, and query theoceanbase.DBA_OB_BACKUP_DELETE_JOBSorsys.DBA_OB_BACKUP_DELETE_JOBSview from a user tenant for the progress of the cleanup jobs of the current tenant.To query the progress of the cleanup jobs of all user tenants from the sys tenant, execute the following statement:
obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_JOBS\G *************************** 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: 2022-05-31 12:09:40.060284 JOB_LEVEL: USER_TENANT START_TIMESTAMP: 2022-06-01 12:09:53.389512 END_TIMESTAMP: STATUS: DOING TASK_COUNT: 2 SUCCESS_TASK_COUNT: 1 RESULT: 0 COMMENT: 1 row in setA job for cleaning up expired backup data is initiated at
2022-06-01 12:09:53.389512from the user tenant with the ID1002. The backup data expired at or earlier than2022-05-31 12:09:40.060284is cleaned up. Therefore, the value of therecovery_windowparameter in the cleanup strategy of this tenant is1d. The value ofTASK_COUNTis2, indicating that two backup set or backup piece cleanup tasks are being executed. The value ofSUCCESS_TASK_COUNTis1, indicating that one task has been completed. Therefore, the task completion rate is 50%, which is calculated by using the following formula:SUCCESS_TASK_COUNT/TASK_COUNT × 100%.Query the progress of the backup set/backup piece cleanup tasks.
You can query the
oceanbase.CDB_OB_BACKUP_DELETE_TASKSview from the sys tenant for the progress of backup set/backup piece cleanup tasks of all user tenants, and query theoceanbase.DBA_OB_BACKUP_DELETE_TASKSorsys.DBA_OB_BACKUP_DELETE_TASKSview from a user tenant for the progress of backup set/backup piece cleanup tasks of the current tenant.To query the progress of the backup set/backup piece cleanup tasks of all tenants from the sys tenant, execute the following statement:
obclient> SELECT * FROM oceanbase.CDB_OB_BACKUP_DELETE_TASKS\G *************************** 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: 2022-06-01 12:09:50.800772 END_TIMESTAMP: 2022-06-01 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: 2022-06-01 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 setAccording to the query result, the backup file of the data backup with
backup_set_id=1in the destinationfile:///data/nfs/backup/datahas been deleted, and the task completion rate is 100%, which is calculated by using the following formula:FINISH_LS_COUNT/TOTAL_LS_COUNT × 100%. In the destinationfile:///data/nfs/backup/archive, the backup file of archive logs withround_id=1/backup_piece_id=1is being deleted, and the task completion rate is 50%, which is calculated by using the following formula:FINISH_LS_COUNT/TOTAL_LS_COUNT × 100%. You can query the information about the initiated cleanup tasks in the job-level view based onJOB_ID.