Purpose
This statement is used to clear the sequence cache.
Note
This statement was introduced in V4.4.1.
Privilege requirements
To execute this statement, the current user must have the ALTER SYSTEM privilege. For more information about OceanBase Database privileges, see Privilege types in MySQL-compatible mode.
Syntax
ALTER SYSTEM FLUSH SEQUENCE CACHE
SEQUENCE_NAME = sequence_name
TENANT = 'tenant_name'
DATABASES = 'database_name'
[GLOBAL];
Parameters
| Parameter | Description |
|---|---|
| SEQUENCE_NAME = 'sequence_name' | Specifies the name of the sequence whose local cache needs to be cleared. |
| TENANT = 'tenant_name' | Specifies the tenant under which this operation is executed. |
| DATABASES = 'database_name' | Specifies the database under which this operation is executed. |
| GLOBAL | Optional. Specifies to clear the cache on all nodes. If this parameter is not specified, only the cache on the current node is cleared. |
Examples
Clear the cache of the sequence named
test_seq1on the current node in thetestdatabase of themysql001tenant.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1 DATABASES = 'test' TENANT = 'mysql001';Clear the cache of the sequence named
test_seq1on all nodes in thetestdatabase of themysql001tenant.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1 DATABASES = 'test' TENANT = 'mysql001' GLOBAL;