After you perform full restore, you can query a view for the restore progress.
Procedure
Log on to the
systenant of the cluster as therootuser.Access the database named
oceanbase.obclient [(none)]> USE oceanbase;Execute the following statement to view the restore progress:
obclient [oceanbase]> SELECT * FROM CDB_OB_RESTORE_PROGRESS\G *************************** 1. row *************************** TENANT_ID: 1 JOB_ID: 1 RESTORE_TENANT_NAME: mysql RESTORE_TENANT_ID: 1002 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=small_pool_2&primary_zone=z1 RESTORE_SCN: 1658285759724047000 RESTORE_SCN_DISPLAY: 2022-06-1 02:55:59.724047 STATUS: WAIT_TENANT_RESTORE_FINISH START_TIMESTAMP: 2022-06-1 10:58:33.689560 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/2_1_2,file:///data/nfs/backup/archive/2_1_3 TOTAL_BYTES: NULL TOTAL_BYTES_DISPLAY: NULL FINISH_BYTES: NULL FINISH_BYTES_DISPLAY: NULL DESCRIPTION: *************************** 2. row *************************** TENANT_ID: 1002 JOB_ID: 1 RESTORE_TENANT_NAME: mysql RESTORE_TENANT_ID: 1002 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=small_pool_2&primary_zone=z1 RESTORE_SCN: 1658285759724047000 RESTORE_SCN_DISPLAY: 2022-06-1 02:55:59.724047 STATUS: RESTORING START_TIMESTAMP: 2022-06-1 10:58:33.689560 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/2_1_2,file:///data/nfs/backup/archive/2_1_3 TOTAL_BYTES: 313158553 TOTAL_BYTES_DISPLAY: 298.65MB 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.
During the restore process, two records are generated for each restore job: one for the
systenant and one for the restored tenant. The job record for thesystenant captures the restore-related information for the restored tenant, while the job record for the restored tenant focuses on tracking its own restore progress.Pay attention to the
statuscolumn in the restore progress view. Here is a breakdown of thestatusvalues for thesystenant and restored tenant:For the
systenant:CREATE_TENANT: Thesystenant is creating the tenant to be restored. After the tenant is created, the status changes toWAIT_TENANT_RESTORE_FINISH. If the creation failed, 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 toPOST_CHECK. If the restore fails, the status changes toRESTORE_FAIL.POST_CHECK: The system is checking the role of the tenant and restoring the tenant as a standby database. After the operation is completed, the status changes toUPGRADE. If the operation failed, the status changes toRESTORE_FAIL.UPGRADE: The tenant is being upgraded. For restore across versions, an upgrade is performed for the tenant. After the operation is completed, the status changes toRESTORE_SUCCESS. If the operation failed, 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 Query the restore result.