Note
This view is available starting with V4.0.0.
Purpose
This view displays information about all auto-increment columns in the current tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CREATE_TIME | datetime(6) | YES | The creation time of the auto-increment column. |
| MODIFY_TIME | datetime(6) | YES | The last modification time of the auto-increment column. |
| AUTO_INCREMENT_KEY | bigint(20) | NO | The key of the table that contains the auto-increment column. |
| COLUMN_ID | bigint(20) | NO | The ID of the column. |
| AUTO_INCREMENT_VALUE | bigint(20) unsigned | YES | The next available auto-increment value. |
| SYNC_VALUE | bigint(20) unsigned | NO | The value explicitly specified for the auto-increment column by using the INSERT statement, which is greater than the current value of the auto-increment column. |
Sample query
Query all auto-increment columns in the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_AUTO_INCREMENT;
The query result is as follows:
+----------------------------+----------------------------+--------------------+-----------+----------------------+------------+
| CREATE_TIME | MODIFY_TIME | AUTO_INCREMENT_KEY | COLUMN_ID | AUTO_INCREMENT_VALUE | SYNC_VALUE |
+----------------------------+----------------------------+--------------------+-----------+----------------------+------------+
| 2025-02-20 14:45:50.310872 | 2025-02-20 14:45:50.310872 | 500007 | 16 | 1 | 0 |
+----------------------------+----------------------------+--------------------+-----------+----------------------+------------+
1 row in set
References
For more information about auto-increment columns, see Define an auto-increment column.