Purpose
You can use this statement to trigger a refresh operation, including refreshing the schema, time zone information, and various caches.
This statement can be executed only in the sys tenant.
Syntax
alter_system_refresh_stmt:
ALTER SYSTEM refresh_action;
refresh_action:
REFRESH SCHEMA
| REFRESH TIME_ZONE_INFO
| FLUSH LOCATION CACHE [TENANT [=] tenant_list]
| FLUSH KVCACHE [TENANT [=] tenant_name] [CACHE [=] cache_name]
tenant_list:
tenant_name,tenant_name ...
Parameters
| Parameter | Description |
|---|---|
| REFRESH SCHEMA | Refreshes the schema. Note: When the system performs DDL operations, RootService notifies all OBServer nodes to refresh the schema. If some OBServer nodes are disconnected from RootService due to exceptions, you must manually refresh the schema on them. |
| REFRESH TIME_ZONE_INFO | Notifies all servers in the cluster to update the local time zone information.
NoteThe current version does not support this parameter. |
| FLUSH LOCATION CACHE | Clears the location cache. |
| FLUSH KVCACHE | Clears auto-scaling memory (KVCache).
|
Examples
Refreshes the schema.
obclient> ALTER SYSTEM REFRESH SCHEMA; Query OK, 0 rows affectedRefresh the cache at the specified location.
obclient> ALTER SYSTEM FLUSH LOCATION CACHE; Query OK, 0 rows affectedRefresh all KVCaches.
obclient> ALTER SYSTEM FLUSH KVCACHE; Query OK, 0 rows affectedRefresh the KVCache of the
MySQLtenant.obclient> ALTER SYSTEM FLUSH KVCACHE TENANT 'MySQL'; Query OK, 0 rows affected