Overview
The oceanbase.DBA_OB_TTL_TASKS view is used to display the execution status of TTL tasks for the current tenant in SQL mode.
Columns
field |
Type |
Is NULL |
Description |
|---|---|---|---|
| TABLE_NAME | varchar(256) | NO | Table name |
| TABLE_ID | bigint(20) | NO | Table ID |
| TASK_ID | bigint(20) | NO | The ID of the current batch task. |
| START_TIME | timestamp(6) | NO | Task Start Time |
| MODIFIED_TIME | timestamp(6) | NO | Row Update Time |
| TRIGGER_TYPE | varchar(8) | NO | Task trigger type:
|
| STATUS | varchar(10) | NO | Task status:
|
| RET_CODE | varchar(512) | NO | Error code returned at the end of the task |
| TASK_TYPE | varchar(10) | NO | TTL task type:
|
Sample query
Users can query the execution status of the TTL task for their own 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
View the execution history of TTL tasks for the current tenant: DBA_OB_TTL_TASK_HISTORY
View the TTL tasks of all user tenants: