During data restore, you can view the physical restore progress in views.
Procedure
Log in as the
rootuser to thesystenant of the cluster where the tenant to be restored resides.Execute the following statement to view 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: 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: s3://data/backup/archive?host=obs.****.myhuaweicloud.com,s3://data/backup/data?host=obs.****.myhuaweicloud.com 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: s3://data/backup/data/backup_set_1_full?host=obs.****.myhuaweicloud.com BACKUP_PIECE_LIST: s3://data/backup/archive/piece_d1001r1p1?host=obs.****.myhuaweicloud.com,s3://data/backup/archive/?host=obs.****.myhuaweicloud.compiece_d1001r2p2 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: 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: s3://data/backup//archive?host=obs.****.myhuaweicloud.com,s3://data/backup/data?host=obs.****.myhuaweicloud.com 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: s3://data/backup/data/backup_set_1_full?host=obs.****.myhuaweicloud.com BACKUP_PIECE_LIST: s3://data/backup/archive/piece_d1001r1p1?host=obs.****.myhuaweicloud.com,s3://data/backup/archive/piece_d1001r2p2?host=obs.****.myhuaweicloud.com TABLET_COUNT: NULL FINISH_TABLET_COUNT: NULL RESTORE_PROGRESS: 66.97 TOTAL_BYTES: 313158553 TOTAL_BYTES_DISPLAY: 298.65MB FINISH_BYTES: 209715200 FINISH_BYTES_DISPLAY: 200.00MB DESCRIPTION: 2 rows in setThis view records information such as the parameters entered during restore and the restore progress.
One tenant restore corresponds to two task records: the task record of the
systenant and the task record of the restored tenant. The task record of thesystenant mainly records information about the restore of the restored tenant, and the task record of the restored tenant mainly records its own restore progress.During restore, pay attention to the
STATUScolumn in the restore progress view: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 fails, the status changes toRESTORE_FAIL.WAIT_TENANT_RESTORE_FINISH: The system is waiting for the restore of the tenant to be restored 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 successfully.RESTORE_FAIL: The restore of the tenant failed.
For the restored 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 fails, 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 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 Introduction to views related to physical restore.After restore is complete, you can view the restore result. For more information, see View the result of physical restore.