Note
This view is available starting with V4.6.0.
Purpose
The oceanbase.CDB_OB_TTL_TASKS view displays the execution status of all tenant-level TTL tasks in SQL mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| TABLE_NAME | varchar(256) | NO | The table name. |
| TABLE_ID | bigint(20) | NO | The table ID. |
| TASK_ID | bigint(20) | NO | The ID of the current batch task. |
| START_TIME | timestamp(6) | NO | The start time of the task. |
| MODIFIED_TIME | timestamp(6) | NO | The update time of the row. |
| TRIGGER_TYPE | varchar(8) | NO | The type of the task trigger:
|
| STATUS | varchar(10) | NO | The status of the task:
|
| RET_CODE | varchar(512) | NO | The error code returned when the task ends. |
| TASK_TYPE | varchar(10) | NO | The type of the TTL task:
|
Sample query
Query the execution status of all tenant-level TTL tasks in the sys tenant.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.CDB_OB_TTL_TASKS;
The query result is as follows:
+-----------+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
| TENANT_ID | TABLE_NAME | TABLE_ID | TASK_ID | START_TIME | MODIFIED_TIME | TRIGGER_TYPE | STATUS | RET_CODE | TASK_TYPE |
+-----------+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
| 1002 | NULL | -1 | 2 | 2026-03-11 10:41:13.700826 | 2026-03-11 10:41:13.700826 | USER | TRIGGERING | OB_SUCCESS | COMPACTION |
+-----------+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
1 row in set
References
View the execution history of all tenant-level TTL tasks: CDB_OB_TTL_TASK_HISTORY
