This topic describes how to control the execution of background tasks for custom hot cache strategies using SQL statements, including suspending, resuming, and manually triggering these tasks.
Suspend/Resume Background Cache Tasks
OceanBase Database provides the suspend_storage_cache_task parameter to control whether to suspend background cache tasks. The valid values are as follows:
True: Suspends (pauses) all ongoing and newly initiated cache tasks.False: Does not suspend background cache tasks, effectively resuming suspended tasks.
For more information about this parameter, see suspend_storage_cache_task.
Examples
Execute the following command to suspend all hot cache tasks under the tenant.
obclient> ALTER SYSTEM SET suspend_storage_cache_task = true;Execute the following command to resume all suspended 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 a hot data cache task:
ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
Example
Execute the following command to manually trigger a hot cache task.
obclient> ALTER SYSTEM TRIGGER STORAGE_CACHE_POLICY_EXECUTOR;
References
- For 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.