After you perform full restore, you can query the related view for the restore result.
Procedure
Log on to the
systenant of the cluster as therootuser.Access the database named
oceanbase.obclient [(none)]> USE oceanbase;After the restore job is completed, execute the following statements to view the restore result.
For example:
obclient [oceanbase]> SELECT * FROM CDB_OB_RESTORE_HISTORY\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_SCN: 1658389117092435000 RESTORE_SCN_DISPLAY: 2022-06-1 07:38:37.092435 RESTORE_OPTION: pool_list=small_pool_2&primary_zone=z1 START_TIMESTAMP: 2022-06-1 15:40:58.366601 FINISH_TIMESTAMP: 2022-06-1 15:44:16.061358 STATUS: SUCCESS BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/2_1_2,file:///data/nfs/backup/archive/2_1_3 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_CLUSTER_VERSION: 17179869184 LS_COUNT: 3 FINISH_LS_COUNT: 3 TABLET_COUNT: 428 FINISH_TABLET_COUNT: 428 TOTAL_BYTES: 313158553 TOTAL_BYTES_DISPLAY: 298.65MB FINISH_BYTES: 0 FINISH_BYTES_DISPLAY: 0.00MB DESCRIPTION: NULL COMMENT: NULL *************************** 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_SCN: 1658389117092435000 RESTORE_SCN_DISPLAY: 2022-06-1 07:38:37.092435 RESTORE_OPTION: pool_list=small_pool_2&primary_zone=z1 START_TIMESTAMP: 2022-06-1 15:40:58.366601 FINISH_TIMESTAMP: 2022-06-1 15:44:05.304540 STATUS: SUCCESS BACKUP_PIECE_LIST: file:///data/nfs/backup/archive/2_1_2,file:///data/nfs/backup/archive/2_1_3 BACKUP_SET_LIST: file:///data/nfs/backup/data/backup_set_1_full BACKUP_CLUSTER_VERSION: 17179869184 LS_COUNT: 3 FINISH_LS_COUNT: 3 TABLET_COUNT: 428 FINISH_TABLET_COUNT: 428 TOTAL_BYTES: 313158553 TOTAL_BYTES_DISPLAY: 298.65MB FINISH_BYTES: 0 FINISH_BYTES_DISPLAY: 0.00MB DESCRIPTION: NULL COMMENT: NULLThe fields in the
CDB_OB_RESTORE_HISTORYview correspond to those in theCDB_OB_RESTORE_PROGRESSview. TheCOMMENTfield records the error information of a failed job or task.If the restore failed, you can cancel the restore by deleting the tenant. For more information, see Cancel the restore.
What to do next
After the restore succeeded, the restored tenant is a standby tenant. You can perform the following operations:
Execute the
RECOVERstatement to proceed to log replay from the source tenant. For more information, see Replay logs to a standby tenant.Execute the ACTIVATE statement to change the role of the standby tenant to PRIMARY. For more information, see Change the role of a standby tenant to PRIMARY.