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 modification time of the auto-increment column. |
| AUTO_INCREMENT_KEY | bigint(20) | NO | The key of the table where the auto-increment column is located. |
| 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 synchronization value, which is the value explicitly specified for the auto-increment column by using the INSERT statement and 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:37:01.322987 | 2025-02-20 14:37:07.197611 | 500006 | 16 | 1000001 | 0 |
| 2025-02-20 14:39:18.505040 | 2025-02-20 14:39:18.505040 | 500008 | 16 | 1 | 0 |
+----------------------------+----------------------------+--------------------+-----------+----------------------+------------+
2 rows in set
References
For more information about auto-increment columns, see Define an auto-increment column.