After a table-level restore task is completed, you can check the results of the restore task in the corresponding view.
Procedure
Log in to the cluster where the target tenant for table-level restore resides as the
rootuser.Run the following commands to check the table-level restore results.
For more information about the fields in the
CDB_OB_RECOVER_TABLE_JOB_HISTORY,CDB_OB_IMPORT_TABLE_JOB_HISTORY, andCDB_OB_IMPORT_TABLE_TASK_HISTORYviews, see Physical restore views.Check the result of the entire table-level restore task
obclient> SELECT * FROM oceanbase.CDB_OB_RECOVER_TABLE_JOB_HISTORY\GThe fields in the
CDB_OB_RECOVER_TABLE_JOB_HISTORYview are basically the same as those in theCDB_OB_RECOVER_TABLE_JOBSview. TheCOMMENTfield is used to record the error information when the task fails.The query result is as follows:
Example 1: All target tables are restored
*************************** 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: COMPLETED AUX_TENANT_NAME: AUX_RECOVER$1692106995896258 TARGET_TENANT_NAME: backup_tenant IMPORT_ALL: 0 DB_LIST: `DB` TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` 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`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: RESULT: SUCCESS COMMENT: import succeed table count: 3, failed table count: 0 DESCRIPTION: NULL 1 row in setExample 2: Some target tables are restored, while others are not
*************************** 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: COMPLETED AUX_TENANT_NAME: AUX_RECOVER$1692106995896258 TARGET_TENANT_NAME: backup_tenant IMPORT_ALL: 0 DB_LIST: `DB` TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` 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`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: RESULT: PARTIAL_SUCCESS COMMENT: import succeed table count: 2, failed table count: 1 DESCRIPTION: NULL 1 row in setExample 3: The table-level restore task is canceled, and some target tables are restored
*************************** 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: COMPLETED AUX_TENANT_NAME: AUX_RECOVER$1692106995896258 TARGET_TENANT_NAME: backup_tenant IMPORT_ALL: 0 DB_LIST: `DB` TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` 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`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: RESULT: PARTIAL_SUCCESS COMMENT: comment: OB_CANCEL(-4072), addr:11.xxx.xxx.xxx:18000, trace_id:Y4********-**********-0-0 DESCRIPTION: NULL 1 row in setExample 4: All target tables are not restored
*************************** 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: COMPLETED AUX_TENANT_NAME: AUX_RECOVER$1692106995896258 TARGET_TENANT_NAME: backup_tenant IMPORT_ALL: 0 DB_LIST: `DB` TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` 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`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: RESULT: FAILED COMMENT: import succeed table count: 0, failed table count: 3 DESCRIPTION: NULL 1 row in set
Check the result of the restore task for the auxiliary tenant
obclient> SELECT * FROM oceanbase.CDB_OB_RESTORE_HISTORY\GThe restore process for the auxiliary tenant is the same as that for tenant-level physical restore. For more information, see Check the result of physical restore.
Check the result of the cross-tenant import task for the target tenant
obclient> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_JOB_HISTORY\GThe fields in the
CDB_OB_IMPORT_TABLE_JOB_HISTORYview are basically the same as those in theCDB_OB_IMPORT_TABLE_JOBSview. TheCOMMENTfield is used to record the error information when the task fails.The query result is as follows:
Example 1: All target tables are restored
*************************** 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_FINISH IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: TOTAL_TABLE_COUNT: 3 FINISHED_TABLE_COUNT: 3 FAILED_TABLE_COUNT: 0 RESULT: SUCCESS COMMENT: import succeed table count: 3, failed table count: 0 1 row in setExample 2: Some target tables are restored, while others are not
*************************** 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_FINISH IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: TOTAL_TABLE_COUNT: 3 FINISHED_TABLE_COUNT: 2 FAILED_TABLE_COUNT: 1 RESULT: PARTIAL_SUCCESS COMMENT: import succeed table count: 2, failed table count: 1 1 row in setExample 3: The table-level restore task is canceled, and some target tables are restored
*************************** 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_FINISH IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: TOTAL_TABLE_COUNT: 3 FINISHED_TABLE_COUNT: 2 FAILED_TABLE_COUNT: 1 RESULT: PARTIAL_SUCCESS COMMENT: comment: OB_CANCEL(-4072), addr:11.xxx.xxx.xxx:18000, trace_id:Y4********-**********-0-0 1 row in setExample 4: All target tables are not restored
*************************** 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_FINISH IMPORT_ALL: 0 DB_LIST: TABLE_LIST: `TEST`.`T1`,`TEST`.`T2`,`TEST`.`T3` REMAP_DB_LIST: REMAP_TABLE_LIST: `TEST`.`T1`:`RECOVER_TEST`.`T1`,`TEST`.`T2`:`RECOVER_TEST`.`T2`,`TEST`.`T3`:`RECOVER_TEST`.`T3` REMAP_TABLEGROUP_LIST: REMAP_TABLESPACE_LIST: TOTAL_TABLE_COUNT: 3 FINISHED_TABLE_COUNT: 0 FAILED_TABLE_COUNT: 3 RESULT: FAILED COMMENT: import succeed table count: 0, failed table count: 3 1 row in set
Check the result of importing each table
obclient> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_TASK_HISTORY\GThe fields in the
CDB_OB_IMPORT_TABLE_TASK_HISTORYview are basically the same as those in theCDB_OB_IMPORT_TABLE_TASKSview. TheCOMMENTfield is used to record the error information when the task fails.The query result is as follows:
Example 1: The target table is restored, and all schemas associated with the target table are restored
*************************** 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: T1 TABLE_COLUMN: 7 STATUS: FINISH START_TIMESTAMP: 2023-08-16 21:08:49.492389 COMPLETION_TIMESTAMP: 2023-08-16 21:09:09.624866 CUMULATIVE_TS: -1 TOTAL_INDEX_COUNT: 2 IMPORTED_INDEX_COUNT: 2 FAILED_INDEX_COUNT: 0 TOTAL_CONSTRAINT_COUNT: 1 IMPORTED_CONSTRAINT_COUNT: 1 FAILED_CONSTRAINT_COUNT: 0 TOTAL_REF_CONSTRAINT_COUNT: 0 IMPORTED_REF_CONSTRAINT_COUNT: 0 FAILED_REF_CONSTRAINT_COUNT: 0 RESULT: SUCCEESS COMMENT: 1 row in setExample 2: The target table is restored, but the user deletes the restored target table
*************************** 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: T1 TABLE_COLUMN: 7 STATUS: FINISH START_TIMESTAMP: 2023-08-16 21:08:49.492389 COMPLETION_TIMESTAMP: 2023-08-16 21:09:09.624866 CUMULATIVE_TS: -1 TOTAL_INDEX_COUNT: 2 IMPORTED_INDEX_COUNT: 2 FAILED_INDEX_COUNT: 0 TOTAL_CONSTRAINT_COUNT: 1 IMPORTED_CONSTRAINT_COUNT: 1 FAILED_CONSTRAINT_COUNT: 0 TOTAL_REF_CONSTRAINT_COUNT: 0 IMPORTED_REF_CONSTRAINT_COUNT: 0 FAILED_REF_CONSTRAINT_COUNT: 0 RESULT: SUCCEESS COMMENT: table type_tbl has been deleted by user 1 row in setExample 3: The target table is restored, but the schemas associated with the target table are partially restored
Generally, failures to restore schema objects associated with a table—such as index tables, constraints, or foreign keys—do not affect the restoration of the main table itself. For example, in the following returned result, a
FAILED_INDEX_COUNTvalue of1indicates that one index associated with the target table failed to be restored, but the restoration of the main table task was still successful.However, in Oracle-compatible mode, table constraint names must be unique within a user. If the restoration of a table's primary key constraint fails due to a constraint name conflict, this will affect the restoration of the main table and cause the entire table restore task to fail.
*************************** 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: T1 TABLE_COLUMN: 7 STATUS: FINISH START_TIMESTAMP: 2023-08-16 21:08:49.492389 COMPLETION_TIMESTAMP: 2023-08-16 21:09:09.624866 CUMULATIVE_TS: -1 TOTAL_INDEX_COUNT: 2 IMPORTED_INDEX_COUNT: 1 FAILED_INDEX_COUNT: 1 TOTAL_CONSTRAINT_COUNT: 1 IMPORTED_CONSTRAINT_COUNT: 1 FAILED_CONSTRAINT_COUNT: 0 TOTAL_REF_CONSTRAINT_COUNT: 0 IMPORTED_REF_CONSTRAINT_COUNT: 0 FAILED_REF_CONSTRAINT_COUNT: 0 RESULT: SUCCEESS COMMENT: 1 row in set