Description
This statement is used to clear the sequence cache.
Privilege requirements
The current user must have the ALTER SYSTEM privilege to execute this statement. For more information about OceanBase AI Database privileges, see Permission classification.
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 in which database to perform this operation. If this parameter is not specified, the operation is performed in the current database. |
| GLOBAL | Optional. Clears the cache on all nodes. If this parameter is not specified, only the cache on the current node is cleared. |
Examples
Purge the cache on this node for the sequence named
test_seq1under the current tenant and database.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1;Purge the cache with the sequence name
test_seq1from all nodes in the current tenant and database.obclient> ALTER SYSTEM FLUSH SEQUENCE CACHE SEQUENCE_NAME = test_seq1 GLOBAL;Purge the cache named
test_seq1from 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 detailed syntax information about creating a sequence, see CREATE SEQUENCE.