REFRESH

2023-12-25 08:49:41  Updated

Purpose

You can use this statement to trigger a refresh operation, including refreshing the schema, time zone information, and various caches.

You can execute this statement 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.

Note

The current version does not support this parameter.

FLUSH LOCATION CACHE Clears the location cache.
FLUSH KVCACHE Clears auto-scaling memory (KVCache).
  • If tenant_name and cache_name are specified, the specified KVCache of the specified tenant is cleared.
  • If only tenant_name is specified, all KVCaches of the specified tenant are cleared.
  • If tenant_name and cache_name are not specified, all KVCaches of all tenants are cleared.

Examples

  • Refresh the schema.

    obclient> ALTER SYSTEM REFRESH SCHEMA;
    Query OK, 0 rows affected
    
  • Refresh the cache at the specified location.

    obclient> ALTER SYSTEM FLUSH LOCATION CACHE;
    Query OK, 0 rows affected
    
  • Refresh all KVCaches.

    obclient> ALTER SYSTEM FLUSH KVCACHE;
    Query OK, 0 rows affected
    
  • Refresh the KVCache of the MySQL tenant.

    obclient> ALTER SYSTEM FLUSH KVCACHE TENANT 'MySQL';
    Query OK, 0 rows affected
    

Contact Us