Note
This view is available starting with V4.2.1.
Purpose
This view displays the history of import tasks at the tenant level.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The ID of the tenant to which the task belongs. |
| JOB_ID | bigint(20) | NO | The ID of the task. |
| INITIATOR_TENANT_ID | bigint(20) | NO | The ID of the tenant to which the parent task belongs. |
| INITIATOR_JOB_ID | bigint(20) | NO | The ID of the parent task. |
| START_TIMESTAMP | timestamp(6) | NO | The current time of the tenant when the task starts. |
| FINISH_TIMESTAMP | timestamp(6) | NO | The current time of the tenant when the task finishes. |
| SRC_TENANT_NAME | varchar(64) | NO | The name of the source tenant. |
| SRC_TENANT_ID | bigint(20) | NO | The ID of the source tenant. |
| STATUS | varchar(64) | NO | The status of the import task. Valid value: IMPORT_FINISH. |
| IMPORT_ALL | tinyint(4) | NO | Indicates whether to import all tables under the tenant. The value is 1 only when the RECOVER TABLE *.* clause is specified. In other scenarios, the value is 0. |
| DB_LIST | longtext | YES | The list of databases to be fully recovered. |
| TABLE_LIST | longtext | YES | The list of tables to be recovered. |
| REMAP_DB_LIST | longtext | YES | The list of databases to be renamed. The format is db1:new_db1, db2:newdb2. |
| REMAP_TABLE_LIST | longtext | YES | The list of tables to be renamed. The format is db1.t1:new_t1, db1.t2:db2.new_t2. |
| REMAP_TABLEGROUP_LIST | longtext | YES | The list of table groups to be remapped. The format is tg1:new_tg1, tg2:new_tg2. This parameter specifies the table groups to which tables are to be remapped. |
| REMAP_TABLESPACE_LIST | longtext | YES | The list of tablespaces to be remapped. The format is ts1:new_ts1, ts2:new_ts2. This parameter specifies the tablespaces to which tables are to be remapped. |
| TOTAL_TABLE_COUNT | bigint(20) | NO | The total number of tables to be imported. |
| FINISHED_TABLE_COUNT | bigint(20) | NO | The number of tables that have been imported. |
| FAILED_TABLE_COUNT | bigint(20) | NO | The number of tables that failed to be imported. |
| RESULT | varchar(64) | YES | The result of the table-level restore task. Valid values: SUCCESS and FAIL. |
| COMMENT | longtext | YES | The comment. |
| DESCRIPTION | longtext | YES | The DESCRIPTION information specified in the restore command. |
Sample query
After a table restore task is completed, the sys tenant queries the history of cross-tenant import tasks of the target tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_IMPORT_TABLE_JOB_HISTORY\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1002
JOB_ID: 6
INITIATOR_TENANT_ID: 1002
INITIATOR_JOB_ID: 5
START_TIMESTAMP: 2025-01-07 16:11:32.874841
FINISH_TIMESTAMP: 2025-01-07 16:12:33.333660
SRC_TENANT_NAME: AUX_RECOVER$1736237253959061
SRC_TENANT_ID: 1008
STATUS: IMPORT_FINISH
IMPORT_ALL: 0
DB_LIST:
TABLE_LIST: `infotest`.`t2`
REMAP_DB_LIST:
REMAP_TABLE_LIST: `infotest`.`t2`:`infotest`.`newtb2`
REMAP_TABLEGROUP_LIST:
REMAP_TABLESPACE_LIST:
TOTAL_TABLE_COUNT: 1
FINISHED_TABLE_COUNT: 1
FAILED_TABLE_COUNT: 0
RESULT: SUCCESS
COMMENT: import succeed table count: 1, failed table count: 0
DESCRIPTION: NULL
1 row in set