This topic describes how to control the execution of background tasks for custom hot cache strategies by using SQL statements, including pausing, resuming, and manually triggering these tasks.
Pause or resume background cache tasks
OceanBase Database provides the suspend_storage_cache_task parameter to control whether to pause background cache tasks. The parameter can be set to the following values:
True: Pauses all ongoing and newly initiated cache tasks.False: Resumes paused background cache tasks.
For more information about this parameter, see suspend_storage_cache_task.
Examples
Execute the following command to pause all hot cache tasks under the tenant.
obclient> ALTER SYSTEM SET suspend_storage_cache_task = true;Execute the following command to resume all paused hot cache tasks under the tenant.
obclient> ALTER SYSTEM SET suspend_storage_cache_task = false;
Manually trigger a hot data cache task
After a custom hot cache strategy is enabled, you can execute the following SQL statement to manually trigger the execution of a hot data cache task:
ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
Examples
Execute the following command to trigger a hot cache task.
obclient> ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
References
- For more information about how to view the real-time status and execution details of hot cache tasks, see V$OB_STORAGE_CACHE_TASKS.
- For more information about custom hot cache strategies, see Overview of custom hot cache strategies.
