Note
This view is available starting with V4.6.0.
Purpose
The oceanbase.DBA_OB_TTL_TASKS view displays the execution status of TTL tasks in the current user tenant in SQL mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TABLE_NAME | varchar(256) | NO | The name of the table. |
| TABLE_ID | bigint(20) | NO | The ID of the table. |
| 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 task trigger:
|
| STATUS | varchar(10) | NO | The status of the task:
|
| RET_CODE | varchar(512) | NO | The error code returned when the task is completed. |
| TASK_TYPE | varchar(10) | NO | The type of the TTL task:
|
Sample query
Query the execution status of TTL tasks in the current user tenant.
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TTL_TASKS;
The query result is as follows:
+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
| TABLE_NAME | TABLE_ID | TASK_ID | START_TIME | MODIFIED_TIME | TRIGGER_TYPE | STATUS | RET_CODE | TASK_TYPE |
+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
| NULL | -1 | 3 | 2026-03-11 11:05:05.235833 | 2026-03-11 11:05:05.235833 | USER | TRIGGERING | OB_SUCCESS | COMPACTION |
+------------+----------+---------+----------------------------+----------------------------+--------------+------------+------------+------------+
1 row in set
References
Query the execution history of TTL tasks in the current user tenant: DBA_OB_TTL_TASK_HISTORY
Query TTL tasks of all user tenants:
