Note
This view is available starting with V4.0.0.
Purpose
This view displays the columns in the primary partitioning key of all partitioned objects in the current tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OWNER | varchar(128) | NO | The owner of the partitioned table or partitioned index. |
| NAME | varchar(128) | NO | The name of the partitioned table or partitioned index. |
| OBJECT_TYPE | varchar(5) | NO | The type of the partitioned object. Valid values: |
| COLUMN_NAME | text | NO | The name of the column. |
| COLUMN_POSITION | bigint(20) | NO | The position of the column in the partitioning key. |
| COLLATED_COLUMN_ID | bigint(0) | NO | This column is not supported. The value of this column is NULL by default. |
Sample query
Query the columns in the primary partitioning key of the partitioned table tbl1_h in the current user tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_PART_KEY_COLUMNS WHERE NAME='tbl1_h';
The query result is as follows:
+----------+--------+-------------+-------------+-----------------+--------------------+
| OWNER | NAME | OBJECT_TYPE | COLUMN_NAME | COLUMN_POSITION | COLLATED_COLUMN_ID |
+----------+--------+-------------+-------------+-----------------+--------------------+
| infotest | tbl1_h | TABLE | col1 | 1 | NULL |
+----------+--------+-------------+-------------+-----------------+--------------------+
1 row in set