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 values are globally ordered |
| CACHE_SIZE | decimal(28,0) | NO | The number of cached values per node |
| LAST_NUMBER | decimal(38,0) | NO | The next value to be allocated to the node |
Sample query
Query the detailed information 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 |
+----------------+---------------+-----------+-----------+--------------+------------+------------+------------+-------------+
| infotest | seq1 | 1 | 10 | 2 | N | N | 30 | 1 |
+----------------+---------------+-----------+-----------+--------------+------------+------------+------------+-------------+
1 row in set
