Note
This view is available starting with V3.1.4.
Overview
Displays the historical TTL tasks of the current tenant.
Columns
Field |
Type |
Nullable |
Description |
|---|---|---|---|
| TABLE_NAME | varchar(256) | NO | Table name |
| TABLE_ID | bigint(20) | NO | Table ID |
| TABLET_ID | bigint(20) | NO | Tablet ID |
| TASK_ID | bigint(20) | NO | Task ID, starting from 1. |
| START_TIME | timestamp(6) | NO | Task Start Time |
| END_TIME | timestamp(6) | NO | End Time |
| TRIGGER_TYPE | varchar(8) | NO | Task trigger type. Valid values: PERIODIC and USER. |
| STATUS | varchar(13) | NO | Current task status. For more information, see the table describing the task status. |
| TTL_DEL_CNT | bigint(20) | NO | Based ontime_to_liveNumber of Records Deleted |
| MAX_VERSION_DEL_CNT | bigint(20) | NO | Based onMAX_VERSIONNumber of Records Deleted |
| SCAN_CNT | bigint(20) | NO | Number of Records Scanned by Task |
| RET_CODE | varchar(512) | NO | Task return code |
| TASK_TYPE | varchar(12) | NO | The type of the TTL task. Valid values: NORMAL and HBASE ROWKEY. Currently, only OBKV-HBase supports the HBASE ROWKEY type. |
| SCAN_INDEX | varchar(128) | NO | Index used for task scanning. The default is PRIMARY KEY. |
Sample query
View the historical TTL tasks of the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_KV_TTL_TASK_HISTORY LIMIT 10\G;
The query result is as follows:
*************************** 1. row ***************************
TABLE_NAME: ttl_table_2
TABLE_ID: 500530
TABLET_ID: 201032
TASK_ID: 2
START_TIME: 2026-04-23 17:46:21.673691
END_TIME: 2026-04-23 17:46:21.673691
TRIGGER_TYPE: USER
STATUS: PREPARED
TTL_DEL_CNT: 0
MAX_VERSION_DEL_CNT: 0
SCAN_CNT: 0
RET_CODE: OB_SUCCESS
TASK_TYPE: NORMAL
SCAN_INDEX: PRIMARY KEY
*************************** 2. row ***************************
TABLE_NAME: ttl_table_2
TABLE_ID: 500530
TABLET_ID: 201033
TASK_ID: 2
START_TIME: 2026-04-23 17:46:21.673697
END_TIME: 2026-04-23 17:46:21.673697
TRIGGER_TYPE: USER
STATUS: PREPARED
TTL_DEL_CNT: 0
MAX_VERSION_DEL_CNT: 0
SCAN_CNT: 0
RET_CODE: OB_SUCCESS
TASK_TYPE: NORMAL
SCAN_INDEX: PRIMARY KEY
*************************** 3. row ***************************
TABLE_NAME: ttl_table_2
TABLE_ID: 500530
TABLET_ID: 201034
TASK_ID: 2
START_TIME: 2026-04-23 17:46:21.673740
END_TIME: 2026-04-23 17:46:21.673740
TRIGGER_TYPE: USER
STATUS: PREPARED
TTL_DEL_CNT: 0
MAX_VERSION_DEL_CNT: 0
SCAN_CNT: 0
RET_CODE: OB_SUCCESS
TASK_TYPE: NORMAL
SCAN_INDEX: PRIMARY KEY
