This topic describes how to control the execution of background tasks for custom hot/cold storage policies by using SQL statements, including suspending, resuming, and manually triggering tasks.
Suspend or resume background cache tasks
OceanBase AI Database provides the suspend_storage_cache_task parameter to specify whether to suspend background cache tasks. Valid values are as follows:
True: Suspends all ongoing and newly initiated cache tasks.False: Does not suspend background cache tasks, which means suspended cache tasks are resumed.
For more information about this parameter, see suspend_storage_cache_task.
Examples
Execute the following statement to suspend all hot cache tasks in a tenant.
obclient> ALTER SYSTEM SET suspend_storage_cache_task = true;Execute the following statement to reactivate all suspended hot cache tasks in a tenant.
obclient> ALTER SYSTEM SET suspend_storage_cache_task = false;
Manually trigger a hot data caching task
After a custom hot/cold storage policy takes effect, you can execute the following SQL statement to manually trigger a hot data caching task immediately:
ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
Example
Execute the following statement to immediately trigger a hot cache task.
obclient> ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
References
- To view the real-time status and execution details of hot cache tasks, see V$OB_STORAGE_CACHE_TASKS.
- For information about custom hot/cold storage policies, see Overview of custom hot/cold storage policies.