Note
This view is available starting with V4.0.0.
Purpose
This view displays the partition information of all tenants' partitioned tables.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| CON_ID | bigint(20) | NO | The tenant ID. |
| TABLE_OWNER | varchar(128) | NO | The user who owns the partitioned table. |
| TABLE_NAME | varchar(128) | NO | The name of the partitioned table. |
| COMPOSITE | varchar(3) | NO | Indicates whether the partitioning is hierarchical. |
| PARTITION_NAME | varchar(128) | NO | The name of the partition. |
| SUBPARTITION_COUNT | bigint(20) | NO | The number of subpartitions. |
| HIGH_VALUE | varchar(262144) | NO | The partitioning expression. |
| HIGH_VALUE_LENGTH | bigint(20) | NO | The length of the partitioning expression. |
| PARTITION_POSITION | bigint(20) | NO | The position of the partition. |
| TABLESPACE_NAME | varchar(30) | NO | The name of the tablespace to which the partition belongs. |
| PCT_FREE | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| PCT_USED | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| INI_TRANS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| MAX_TRANS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| INITIAL_EXTENT | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| NEXT_EXTENT | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| MIN_EXTENT | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| MAX_EXTENT | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| MAX_SIZE | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| PCT_INCREASE | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| FREELISTS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| FREELIST_GROUPS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| LOGGING | varchar(7) | NO | This column is not supported. It is set to NULL by default. |
| COMPRESSION | varchar(8) | NO | Indicates whether compression is enabled. |
| COMPRESS_FOR | varchar(30) | NO | The compression method. |
| NUM_ROWS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| BLOCKS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| EMPTY_BLOCKS | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| AVG_SPACE | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| CHAIN_CNT | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| AVG_ROW_LEN | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| SAMPLE_SIZE | bigint(0) | NO | This column is not supported. It is set to NULL by default. |
| LAST_ANALYZED | date | NO | This column is not supported. It is set to NULL by default. |
| BUFFER_POOL | varchar(7) | NO | This column is not supported. It is set to NULL by default. |
| FLASH_CACHE | varchar(7) | NO | This column is not supported. It is set to NULL by default. |
| CELL_FLASH_CACHE | varchar(7) | NO | This column is not supported. It is set to NULL by default. |
| GLOBAL_STATS | varchar(3) | NO | This column is not supported. It is set to NULL by default. |
| USER_STATS | varchar(3) | NO | This column is not supported. It is set to NULL by default. |
| IS_NESTED | varchar(3) | NO | This column is not supported. It is set to NULL by default. |
| PARENT_TABLE_PARTITION | varchar(128) | NO | This column is not supported and is set to NULL by default. |
| INTERVAL | varchar(3) | NO | This column is not supported and is set to NO by default. |
| SEGMENT_CREATED | varchar(4) | NO | This column is not supported and is set to NULL by default. |
| INDEXING | varchar(4) | NO | This column is not supported and is set to NULL by default. |
| READ_ONLY | varchar(4) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY | varchar(8) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_PRIORITY | varchar(8) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_DISTRIBUTE | varchar(15) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_COMPRESSION | varchar(17) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_DUPLICATE | varchar(13) | NO | This column is not supported and is set to NULL by default. |
| CELLMEMORY | varchar(24) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_SERVICE | varchar(12) | NO | This column is not supported and is set to NULL by default. |
| INMEMORY_SERVICE_NAME | varchar(100) | NO | This column is not supported and is set to NULL by default. |
| MEMOPTIMIZE_READ | varchar(8) | NO | This column is not supported and is set to NULL by default. |
| MEMOPTIMIZE_WRITE | varchar(8) | NO | This column is not supported and is set to NULL by default. |
Sample query
As the system tenant, query the primary partition information of the partitioned table tbl2_f_rl for the tenant with ID 1002.
obclient [oceanbase]> SELECT CON_ID, TABLE_OWNER, TABLE_NAME, COMPOSITE, PARTITION_NAME, SUBPARTITION_COUNT, HIGH_VALUE_LENGTH, PARTITION_POSITION
FROM oceanbase.CDB_TAB_PARTITIONS
WHERE CON_ID=1002 AND TABLE_NAME='tbl2_f_rl';
The query result is as follows:
+--------+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
| CON_ID | TABLE_OWNER | TABLE_NAME | COMPOSITE | PARTITION_NAME | SUBPARTITION_COUNT | HIGH_VALUE_LENGTH | PARTITION_POSITION |
+--------+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
| 1002 | infotest | tbl2_f_rl | YES | p0 | 3 | 3 | 1 |
| 1002 | infotest | tbl2_f_rl | YES | p1 | 3 | 3 | 2 |
+--------+-------------+------------+-----------+----------------+--------------------+-------------------+--------------------+
2 rows in set
References
View the primary partition information of the partitioned tables of the current tenant: DBA_TAB_PARTITIONS
View the secondary partition details of the partitioned tables of all tenants: CDB_TAB_SUBPARTITIONS