Note
This view is available starting with V2.2.77.
Purpose
This view displays all sequences accessible to the current user.
Applicability
This view is applicable only to OceanBase Database in Oracle mode.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SEQUENCE_OWNER | VARCHAR2(128) | NO | The owner of the object. |
| SEQUENCE_NAME | VARCHAR2(128) | NO | The name of the sequence. |
| MIN_VALUE | NUMBER(28) | NO | The minimum value that the sequence can take (inclusive). |
| MAX_VALUE | NUMBER(28) | NO | The maximum value that the sequence can take (inclusive). |
| INCREMENT_BY | NUMBER(28) | NO | The step size for each value, which can be a positive or negative integer but cannot be 0. |
| CYCLE_FLAG | CHAR(1) | NO | Indicates whether the sequence can cycle. |
| ORDER_FLAG | CHAR(1) | NO | Indicates whether the sequence values are globally ordered. |
| CACHE_SIZE | NUMBER(28) | NO | The number of cached values per node. |
| LAST_NUMBER | NUMBER(38) | NO | The value to be allocated to the next node. |
Sample query
Query the details of all sequences accessible to the current user.
obclient [SYS]> SELECT * FROM SYS.ALL_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
Query all sequences in the current tenant: DBA_SEQUENCES
Query sequences owned by the current user: USER_SEQUENCES
