Note
This view is available starting with V4.0.0.
Overview
Displays the template-based subpartition information for partitioned tables of all tenants (excluding the Meta tenant).
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| CON_ID | decimal(10,0) | NO | Tenant ID |
| USER_NAME | varchar(128) | NO | Owner of the partitioned table |
| TABLE_NAME | varchar(128) | NO | Partitioned Table Name |
| SUBPARTITION_NAME | varchar(132) | NO | Subpartition Name |
| SUBPARTITION_POSITION | bigint(21) | NO | Subpartition Location |
| TABLESPACE_NAME | varchar(30) | NO | Tablespace name of the partition |
| HIGH_BOUND | varchar(262144) | NO | Partition template expression |
| COMPRESSION | varchar(4) | NO | Specifies whether the data of each newly added composite partition in the subpartition template is stored in compressed format:
This value can be specified in the subpartition template. |
| INDEXING | varchar(4) | NO | Specifies whether the data of each newly added composite partition in the subpartition template is considered a partial index:
This value can be specified in the subpartition template. |
| READ_ONLY | varchar(4) | NO | Specifies whether the data of each newly added composite partition in the subpartition template is read-only:
This value can be specified in the subpartition template. |
Sample query
The system tenant queries the template-based subpartition information of partitioned tables for all tenants (excluding the Meta tenant).
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_SUBPARTITION_TEMPLATES;
The query result is as follows:
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| CON_ID | USER_NAME | TABLE_NAME | SUBPARTITION_NAME | SUBPARTITION_POSITION | TABLESPACE_NAME | HIGH_BOUND | COMPRESSION | INDEXING | READ_ONLY |
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
| 1 | test | t_m_rclc | mp0 | 1 | NULL | 1,3 | NULL | NULL | NULL |
| 1 | test | t_m_rclc | mp1 | 2 | NULL | 4,6 | NULL | NULL | NULL |
| 1 | test | t_m_rclc | mp2 | 3 | NULL | 7 | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p0 | 1 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p1 | 2 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p2 | 3 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p3 | 4 | NULL | NULL | NULL | NULL | NULL |
| 1002 | infotest | t2_m_rch | p4 | 5 | NULL | NULL | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP0 | 1 | NULL | 100 | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP1 | 2 | NULL | 200 | NULL | NULL | NULL |
| 1004 | SYS | T2_M_LR | MP2 | 3 | NULL | 300 | NULL | NULL | NULL |
+--------+-----------+------------+-------------------+-----------------------+-----------------+------------+-------------+----------+-----------+
11 rows in set
References
View the template-based subpartition information of partitioned tables in the current tenant: DBA_SUBPARTITION_TEMPLATES
How to create a partitioned table: Create a partitioned table
