Note
This view is available starting with V4.0.0.
Overview
Displays all sequences under the current tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| SEQUENCE_ID | bigint(20) | NO | The unique ID of the sequence within the tenant. |
| SCHEMA_VERSION | bigint(20) | NO | SCHEMA version corresponding to the sequence record |
| DATABASE_ID | bigint(20) | NO | ID of the database to which the sequence belongs |
| SEQUENCE_NAME | varchar(128) | NO | Sequence name |
| MIN_VALUE | decimal(28,0) | NO | Minimum Value of Sequence (inclusive) |
| MAX_VALUE | decimal(28,0) | NO | Maximum value that the sequence can take (inclusive) |
| INCREMENT_BY | decimal(28,0) | NO | The step size for each value retrieval, which can be a positive or negative integer, but cannot be 0. |
| START_WITH | decimal(28,0) | NO | Starting value for sequence generation |
| CACHE_SIZE | decimal(28,0) | NO | Number of cached values per node |
| ORDER_FLAG | tinyint(4) | NO | Whether the values are guaranteed to be globally ordered |
| CYCLE_FLAG | tinyint(4) | NO | Whether values can be fetched in a loop |
| IS_SYSTEM_GENERATED | tinyint(4) | NO | Whether it is an internally generated sequence. Currently, sequences generated by IDENTITY COLUMN have this domain set to True. |
Sample query
View all sequences in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_SEQUENCE_OBJECTS;
The query result is as follows:
+-------------+------------------+-------------+---------------+-----------+-----------+--------------+------------+------------+------------+------------+---------------------+
| SEQUENCE_ID | SCHEMA_VERSION | DATABASE_ID | SEQUENCE_NAME | MIN_VALUE | MAX_VALUE | INCREMENT_BY | START_WITH | CACHE_SIZE | ORDER_FLAG | CYCLE_FLAG | IS_SYSTEM_GENERATED |
+-------------+------------------+-------------+---------------+-----------+-----------+--------------+------------+------------+------------+------------+---------------------+
| 500003 | 1675748057234736 | 500002 | seq1 | 1 | 10 | 2 | 1 | 30 | 0 | 0 | 0 |
+-------------+------------------+-------------+---------------+-----------+-----------+--------------+------------+------------+------------+------------+---------------------+
1 row in set
