Note
This view is available starting with V3.1.4.
Overview
Displays the current tenant's running TTL tasks.
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 |
| 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 TTL tasks currently being executed by the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_KV_TTL_TASKS LIMIT 10\G;
The query result is as follows:
*************************** 1. row ***************************
TABLE_NAME: ttl_table_1
TABLE_ID: 501044
TABLET_ID: 201043
TASK_ID: 4
START_TIME: 2026-04-23 17:55:56.205706
END_TIME: 2026-04-23 17:55:56.209232
TRIGGER_TYPE: USER
STATUS: FINISHED
TTL_DEL_CNT: 4
MAX_VERSION_DEL_CNT: 0
SCAN_CNT: 4
RET_CODE: OB_SUCCESS
TASK_TYPE: NORMAL
SCAN_INDEX: PRIMARY KEY
*************************** 2. row ***************************
TABLE_NAME: ttl_table_1
TABLE_ID: 501044
TABLET_ID: 201042
TASK_ID: 4
START_TIME: 2026-04-23 17:55:56.651546
END_TIME: 2026-04-23 17:55:56.655640
TRIGGER_TYPE: USER
STATUS: FINISHED
TTL_DEL_CNT: 2
MAX_VERSION_DEL_CNT: 0
SCAN_CNT: 4
RET_CODE: OB_SUCCESS
TASK_TYPE: NORMAL
SCAN_INDEX: PRIMARY KEY
*************************** 3. row ***************************
TABLE_NAME: ttl_table_1
TABLE_ID: 501044
TABLET_ID: 201041
TASK_ID: 4
START_TIME: 2026-04-23 17:55:52.085123
END_TIME: 2026-04-23 17:55:52.085123
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
