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_OWNER | varchar(128) | NO | The name of the database where the sequence is located. |
| SEQUENCE_NAME | varchar(128) | NO | Sequence name |
| MIN_VALUE | decimal(28,0) | NO | Minimum Value (inclusive) |
| MAX_VALUE | decimal(28,0) | NO | Maximum attainable value (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. |
| CYCLE_FLAG | varchar(1) | NO | Whether values can be fetched in a loop |
| ORDER_FLAG | varchar(1) | NO | Whether the values are guaranteed to be globally ordered |
| CACHE_SIZE | decimal(28,0) | NO | Number of cached values per node |
| LAST_NUMBER | decimal(38,0) | NO | Record the next value that can be allocated to a node. |
Sample query
View detailed information about 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
