Note
This view is introduced since OceanBase Database V2.2.77.
Purpose
The DBA_SEQUENCES view displays all sequences under the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SEQUENCE_OWNER | VARCHAR2(128) | NO | The name of the database in which the sequence resides. |
| SEQUENCE_NAME | VARCHAR2(128) | NO | The name of the sequence. |
| MIN_VALUE | NUMBER(28) | NO | The minimum value of the sequence. |
| MAX_VALUE | NUMBER(28) | NO | The maximum value of the sequence. |
| INCREMENT_BY | NUMBER(28) | NO | The step size by which the sequence is incremented, which can be a positive or negative integer but cannot be 0. |
| CYCLE_FLAG | CHAR(1) | NO | Indicates whether the sequence wraps when it reaches the minimum or maximum value. |
| ORDER_FLAG | CHAR(1) | NO | Indicates whether sequence values are generated in order. |
| CACHE_SIZE | NUMBER(28) | NO | The number of sequence values stored in the cache. |
| LAST_NUMBER | NUMBER(38) | NO | The value of the last sequence number written to the disk. |
Sample query
Query all sequences in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_SEQUENCES;
The query result is as follows:
+----------------+---------------+-----------+------------------------------+--------------+------------+------------+------------+-------------+
| SEQUENCE_OWNER | SEQUENCE_NAME | MIN_VALUE | MAX_VALUE | INCREMENT_BY | CYCLE_FLAG | ORDER_FLAG | CACHE_SIZE | LAST_NUMBER |
+----------------+---------------+-----------+------------------------------+--------------+------------+------------+------------+-------------+
| SYS | SEQ_T1 | 1 | 9999999999999999999999999999 | 1 | N | N | 50 | 10050 |
+----------------+---------------+-----------+------------------------------+--------------+------------+------------+------------+-------------+
1 row in set
References
View all sequences accessible to the current user: ALL_SEQUENCES
View all sequences owned by the current user: USER_SEQUENCES