Purpose
This statement is used to clear the sequence cache.
Note
This statement was introduced in OceanBase Database 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 classification in MySQL-compatible mode.
Syntax
ALTER SYSTEM FLUSH SEQUENCE CACHE
SEQUENCE_NAME = sequence_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. |
| DATABASES = 'database_name' | Optional. Specifies the database in which to execute this operation. If this parameter is not specified, the operation is executed in the current database. |
| GLOBAL | Optional. Specifies to clear the cache on all nodes. If this parameter is not specified, the cache is cleared only on the current node. |
Examples
Clear the cache of the sequence named
test_seq1on the current node in the current tenant and database.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1;Clear the cache of the sequence named
test_seq1on all nodes in the current tenant and database.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1 GLOBAL;Clear the cache of the sequence named
test_seq1on all nodes in the current tenant and the database namedtest.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1 DATABASES = 'test' GLOBAL;
References
For more information about the syntax for creating a sequence, see CREATE SEQUENCE.