Note
This view is available starting with V4.0.0.
Purpose
This view displays all sequences in the current tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| SEQUENCE_OWNER | varchar(128) | NO | The name of the database where the sequence is located. |
| SEQUENCE_NAME | varchar(128) | NO | The name of the sequence. |
| MIN_VALUE | decimal(28,0) | NO | The minimum value that can be taken (inclusive). |
| MAX_VALUE | decimal(28,0) | NO | The maximum value that can be taken (inclusive). |
| INCREMENT_BY | decimal(28,0) | NO | The step size for each value taken, which can be a positive or negative integer, but cannot be 0. |
| CYCLE_FLAG | varchar(1) | NO | Indicates whether the sequence can cycle. |
| ORDER_FLAG | varchar(1) | NO | Indicates whether the sequence values are globally ordered. |
| CACHE_SIZE | decimal(28,0) | NO | The number of cached values on each node. |
| LAST_NUMBER | decimal(38,0) | NO | The next value to be allocated to the node. |
Sample query
Query the details of all sequences in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.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 |
+----------------+-----------------------------------------+-----------+---------------------+--------------+------------+------------+------------+-------------+
| oceanbase | OB_WORKLOAD_REPOSITORY_SNAP_ID_SEQNENCE | 1 | 9223372036854775807 | 1 | Y | Y | 1 | 886 |
+----------------+-----------------------------------------+-----------+---------------------+--------------+------------+------------+------------+-------------+
1 row in set
