After the table restore statement is executed, you can view the table restore progress.
Procedure
Log in as the
rootuser to thesystenant of the cluster where the destination tenant resides.View the table restore progress.
You can query the
CDB_OB_RECOVER_TABLE_JOBSview in thesystenant to check the table restore progress.obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_RECOVER_TABLE_JOBS\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1 JOB_ID: 1 INITIATOR_TENANT_ID: 1 INITIATOR_JOB_ID: 0 START_TIMESTAMP: 2023-06-01 06:00:00.000000 STATUS: RECOVERING AUX_TENANT_NAME: AUX_RECOVER$1692106995896258 TARGET_TENANT_NAME: backup_tenant IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1` RESTORE_SCN: 1692104831498747191 RESTORE_SCN_DISPLAY: 2023-06-01 00:00:00.000000 RESTORE_OPTION: pool_list=small_pool_0&primary_zone=z1 BACKUP_DEST: file:///data2/nfs/ob_backup_oracle_tenant/archive,file:///data2/nfs/ob_backup_oracle_tenant/data BACKUP_SET_LIST: file:///data2/nfs/ob_backup_oracle_tenant/data/backup_set_1_full BACKUP_PIECE_LIST: file:///data2/nfs/ob_backup_oracle_tenant/archive/piece_d1001r1p1 BACKUP_PASSWD: NULL EXTERNAL_KMS_INFO: NULL REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: RESULT: COMMENT: 1 row in setThis view records the restore parameter information entered by the user during the restore process, as well as the restore results and other related information.
The entire process of table restore includes data restore in the auxiliary tenant and data import across tenants. The
CDB_OB_RECOVER_TABLE_JOBSview contains two job records: one for thesystenant and one for the target user tenant itself. The records in this view are as follows:For the
systenant, the job record tracks the progress of table restore for the target user tenant. When the entire table restore job for the target tenant is completed, the job ends.For the target user tenant itself, the job record includes the progress of data restore in the auxiliary and the progress of table import. When both the data restore in the auxiliary tenant and the table import are completed, the job ends.
In the query result,
AUX_RECOVER$1692106995896258indicates the auxiliary tenant,backup_tenantindicates the destination user tenant, and the table to be restored isTEST.T1.STATUSindicates the current stage of the table restore job. Valid values ofSTATUSare as follows:PREPARE: The job is being initialized.RECOVERING: The destination tenant is being restored. This status is displayed only for thesystenant.RESTORE_AUX_TENANT: Data is being restored in the auxiliary tenant.PRECHECK_IMPORT: Pre-import check is being performed.GEN_IMPORT_JOB: The import job is being initialized.IMPORTING: The table is being imported.CANCELING: The job is being canceled.COMPLETED: The job is completed.FAILED: The job failed.
If
STATUSisCOMPLETEDin the view, the table restore is completed. For more information about columns in theCDB_OB_RECOVER_TABLE_JOBSview, see Views related to table restore.Before table restore is completed, you can view the progress of data restore in the auxiliary tenant or the progress of data import to the destination tenant based on the stage of the table restore job.
To view the progress of data restore in the auxiliary tenant, execute the following statement:
obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_RESTORE_PROGRESS\GThe restore of an auxiliary tenant is the same as that of the physical restore of a tenant. For more information about how to view the progress of physical restore, see Query the restore progress.
To view the progress of data import to the destination tenant, execute the following statement:
obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_JOBS\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1010 JOB_ID: 3 INITIATOR_TENANT_ID: 1010 INITIATOR_JOB_ID: 2 START_TIMESTAMP: 2023-08-16 17:59:28.689435 SRC_TENANT_NAME: AUX_RECOVER$1692179849034890 SRC_TENANT_ID: 1014 STATUS: IMPORT_TABLE IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1` REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: TOTAL_TABLE_COUNT: 0 FINISHED_TABLE_COUNT: 0 FAILED_TABLE_COUNT: 0 RESULT: COMMENT: 1 row in setIn the query result,
STATUSisIMPORT_TABLE, indicating that theTEST.T1table is being imported. During table import, you can also view the import details of each table.obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_TASKS\GThe query result is as follows:
*************************** 1. row *************************** TENANT_ID: 1002 TASK_ID: 1047 JOB_ID: 3 SRC_TENANT_ID: 1004 SRC_TABLESPACE: NULL SRC_TABLEGROUP: NULL SRC_DATABASE: test SRC_TABLE: t1 SRC_PARTITION: NULL TARGET_TABLESPACE: NULL TARGET_TABLEGROUP: NULL TARGET_DATABASE: recover_test TARGET_TABLE: t3 TABLE_COLUMN: 7 STATUS: DOING START_TIMESTAMP: 2023-08-16 21:08:49.492389 COMPLETION_TIMESTAMP: CUMULATIVE_TS: -1 TOTAL_INDEX_COUNT: 2 IMPORTED_INDEX_COUNT: 0 FAILED_INDEX_COUNT: 0 TOTAL_CONSTRAINT_COUNT: 1 IMPORTED_CONSTRAINT_COUNT: 0 FAILED_CONSTRAINT_COUNT: 0 TOTAL_REF_CONSTRAINT_COUNT: 1 IMPORTED_REF_CONSTRAINT_COUNT: 0 FAILED_REF_CONSTRAINT_COUNT: 0 RESULT: COMMENT: 1 row in set
For more information about columns in the
CDB_OB_IMPORT_TABLE_JOBSandCDB_OB_IMPORT_TABLE_TASKSviews, see Views related to table restore.