Note
This view is available starting with V4.0.0.
Purpose
This view displays the columns in the primary partitioning key of partitioned objects (partitioned tables and partitioned indexes) of all tenants.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | The tenant ID. |
| 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 primary partitioning key. |
| COLLATED_COLUMN_ID | bigint(0) | NO | This column is not supported. The value of this column is NULL by default. |
Sample query
In the sys tenant, query the columns in the primary partitioning key of the partitioned table tbl2_f_rl in the tenant with ID 1002.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_PART_KEY_COLUMNS WHERE CON_ID=1002 AND NAME='tbl2_f_rl';
The query result is as follows:
+--------+----------+-----------+-------------+-------------+-----------------+--------------------+
| CON_ID | OWNER | NAME | OBJECT_TYPE | COLUMN_NAME | COLUMN_POSITION | COLLATED_COLUMN_ID |
+--------+----------+-----------+-------------+-------------+-----------------+--------------------+
| 1002 | infotest | tbl2_f_rl | TABLE | col1 | 1 | NULL |
+--------+----------+-----------+-------------+-------------+-----------------+--------------------+
1 row in set
References
To query the columns in the primary partitioning key of partitioned objects in the current tenant, see DBA_PART_KEY_COLUMNS.