Check the progress of table-level restore

2026-04-02 06:23:56  Updated

After you execute a table-level restore command, you can check the progress of the table-level restore task in a view.

Procedure

  1. Log in to the sys tenant of the cluster where the target tenant whose tables are to be restored is located as the root user.

  2. Check the progress of the table-level restore task.

    You can check the progress of the entire table-level restore task in the CDB_OB_RECOVER_TABLE_JOBS view of the system tenant.

    obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_RECOVER_TABLE_JOBS\G
    

    A sample 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 set
    

    This view records the restore parameters you specified during the restore process, as well as the restore results.

    The table-level restore process consists of two phases: restoring the auxiliary tenant and importing into the target tenant. The CDB_OB_RECOVER_TABLE_JOBS view contains two task records: one for the sys tenant and one for the target user tenant. Specifically:

    • The task record in the sys tenant mainly tracks the progress of the table-level restore in the target user tenant. When the table-level restore task in the target tenant is complete, the task is considered finished.

    • The task record in the target user tenant tracks both the progress of restoring the auxiliary tenant and the table import. When both the auxiliary tenant restore task and the table import task are complete, the task is considered finished.

    In the query result, AUX_RECOVER$1692106995896258 represents the auxiliary tenant, backup_tenant represents the target user tenant, and TEST.T1 is the table to be restored. The STATUS field indicates the current stage of the table-level restore task:

    • PREPARE: The task is in the initialization phase.
    • RECOVERING: The target tenant is being restored. This status appears only in the sys tenant.
    • RESTORE_AUX_TENANT: The auxiliary tenant is being restored.
    • PRECHECK_IMPORT: A precheck is being performed before the import.
    • GEN_IMPORT_JOB: The import task is being initialized.
    • IMPORTING: The table is being imported.
    • CANCELING: The task is being canceled.
    • COMPLETED: The task is complete.
    • FAILED: The task has failed.

    If the value of STATUS in the view is COMPLETED, it means the table-level restore task has finished. For more information about the fields in the CDB_OB_RECOVER_TABLE_JOBS view, see Table-level restore views.

  3. Before the table-level restore task is completed, you can check the progress of the auxiliary tenant restore task and the target tenant import task based on the current stage of the table-level restore task.

    • During the restore in the auxiliary tenant, check the progress of the auxiliary tenant restore task.

      obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_RESTORE_PROGRESS\G
      

      The restore process in the auxiliary tenant is the same as the tenant-level physical restore process. For more information about how to check the progress of physical restore, see Check the progress of physical restore.

    • During the import of tables, check the progress of the target tenant import task.

      obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_JOBS\G
      

      A sample 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 set
      

      The query result shows that the value of STATUS is IMPORT_TABLE, indicating that the TEST.T1 table is being imported. You can also check the details about the import of each table during the table import process.

      obclient [(none)]> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_TASKS\G
      

      A sample 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 the fields in the CDB_OB_IMPORT_TABLE_JOBS and CDB_OB_IMPORT_TABLE_TASKS views, see Table-level restore views.

Contact Us