Description
The ALTER SYSTEM TRIGGER/SUSPEND/RESUME/CANCEL TTL statement is used to manually trigger, suspend, resume, or cancel a tenant-level Time-To-Live (TTL) task.
Privilege requirements
To execute the ALTER SYSTEM TRIGGER/SUSPEND/RESUME/CANCEL TTL statement, the current user must have the ALTER SYSTEM privilege. For more information about OceanBase AI Database privileges, see Permission classification.
Syntax
ALTER SYSTEM {TRIGGER | SUSPEND | RESUME | CANCEL} TTL [TENANT [=] all | all_user | tenant_list];
tenant_list:
tenant_name[,tenant_name ...]
Parameters
Parameter |
Description |
|---|---|
| TENANT | Specifies the user tenant whose TTL task is to be triggered, paused, resumed, or canceled. When executed by the system tenant, you must specify a user tenant. Multiple tenant names can be specified, separated by commas (,).
NoticeOnly the system tenant needs to specify the target tenant via the |
Examples
The system tenant triggers a TTL task for user tenant
tenant1.Enable the TTL feature for tenant
tenant1.obclient(root@sys)[(none)]> ALTER SYSTEM SET enable_ttl = True TENANT = tenant1;Manually trigger a TTL task for the user tenant
tenant1.obclient(root@sys)[(none)]> ALTER SYSTEM TRIGGER TTL TENANT = tenant1;
A user tenant triggers a TTL task for itself.
Enable the TTL feature.
obclient(root@mysql001)[(none)]> ALTER SYSTEM SET enable_ttl = True;Manually trigger a TTL task.
obclient(root@mysql001)[(none)]> ALTER SYSTEM TRIGGER TTL;
References
For detailed operations and descriptions of TTL tasks in SQL scenarios, see Use the TTL feature.
For more information about the detailed operations of TTL tasks in KV scenarios, see Delete expired data from OBKV-Table and Delete expired data in OBKV-HBase.