During data restore, you can query the physical restore progress from views.
Procedure
Log in as the
rootuser to thesystenant of the cluster where the tenant to restore resides.Execute the following statement to query the restore progress:
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_RESTORE_PROGRESS\GA sample query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1 JOB_ID: 2 RESTORE_TENANT_NAME: mysql RESTORE_TENANT_ID: 1008 BACKUP_TENANT_NAME: backup_tenant BACKUP_TENANT_ID: 1002 BACKUP_CLUSTER_NAME: backup_cluster BACKUP_DEST: file:///data/nfs/backup//archive,file:///data/nfs/backup/data RESTORE_OPTION: pool_list=restore_pool&concurrency=50 RESTORE_SCN: 1711091102560245001 RESTORE_SCN_DISPLAY: 2024-03-22 15:05:02.560245 STATUS: WAIT_TENANT_RESTORE_FINISH START_TIMESTAMP: 2024-03-22 15:06:30.860918 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/piece_d1001r1p1,file:///data/nfs/backup/archive/piece_d1001r2p2 RECOVER_SCN: NULL RECOVER_SCN_DISPLAY: NULL RECOVER_PROGRESS: NULL TABLET_COUNT: NULL FINISH_TABLET_COUNT: NULL RESTORE_PROGRESS: NULL TOTAL_BYTES: NULL TOTAL_BYTES_DISPLAY: NULL FINISH_BYTES: NULL FINISH_BYTES_DISPLAY: NULL DESCRIPTION: *************************** 2. row *************************** TENANT_ID: 1008 JOB_ID: 2 RESTORE_TENANT_NAME: mysql RESTORE_TENANT_ID: 1008 BACKUP_TENANT_NAME: backup_tenant BACKUP_TENANT_ID: 1002 BACKUP_CLUSTER_NAME: backup_cluster BACKUP_DEST: file:///data/nfs/backup//archive,file:///data/nfs/backup/data RESTORE_OPTION: pool_list=restore_pool&concurrency=50 RESTORE_SCN: 1711091102560245001 RESTORE_SCN_DISPLAY: 2024-03-22 15:05:02.560245 STATUS: RESTORING START_TIMESTAMP: 2024-03-22 15:06:30.860918 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/piece_d1001r1p1,file:///data/nfs/backup/archive/piece_d1001r2p2 RECOVER_SCN: 1711084223602400000 RECOVER_SCN_DISPLAY: 2024-03-22 13:10:23.602400 RECOVER_PROGRESS: 72.23 TABLET_COUNT: 1767 FINISH_TABLET_COUNT: 598 RESTORE_PROGRESS: 33.84 TOTAL_BYTES: 23210230 TOTAL_BYTES_DISPLAY: 220.14GB FINISH_BYTES: 0 FINISH_BYTES_DISPLAY: 0.00MB DESCRIPTION: 2 rows in setThis view records the parameters you entered during restore, and other information such as the restore progress.
After a restore job is performed for a user tenant, two records are generated: one for the
systenant and the other for the restored user tenant. The job record for thesystenant records the restore information about the restored tenant but not the restore progress. The job record for the restored tenant records its restore progress.During restore, pay attention to the
STATUScolumn in the restore progress view.For the
systenant:CREATE_TENANT: Thesystenant is creating the target tenant to be restored. After the tenant is created, the status changes toWAIT_TENANT_RESTORE_FINISH. If the creation fails, the status changes toRESTORE_FAIL.WAIT_TENANT_RESTORE_FINISH: The system is waiting for the restore of the tenant to complete. After the tenant is restored, the status changes toRESTORE_SUCCESS. If the restore fails, the status changes toRESTORE_FAIL.RESTORE_SUCCESS: The tenant is restored.RESTORE_FAIL: The restore of the tenant failed.
For the target tenant:
RESTORING: Data of the tenant is being restored. After the tenant is restored, the status changes toRESTORE_SUCCESS. If the restore fails, the status changes toRESTORE_FAIL.RESTORE_SUCCESS: The restore succeeded.RESTORE_FAIL: The restore failed.
For more information about the
CDB_OB_RESTORE_PROGRESSview, see Views related to physical restore.After the restore is completed, you can view the restore result. For more information, see View physical restore results.