Note
For V4.2.5, this view is available starting from V4.2.5 BP2.
Overview
The DBA_OB_OBJECT_BALANCE_WEIGHT view displays all partitions with special weights set under the current user tenant.
Columns
Field Name |
Type |
Whether can be NULL |
Description |
|---|---|---|---|
| TABLE_ID | bigint(20) | NO | Table ID |
| PARTITION_ID | bigint(20) | NO | The ID of the partition. When no partition weight is set, the value isNULL |
| SUBPARTITION_ID | bigint(20) | NO | Subpartition ID. When partition weight is not set, the value isNULL, setting subpartition weights is currently not supported |
| WEIGHT | bigint(20) | NO | Partition Weight |
| DATABASE_NAME | varchar(128) | NO | The name of the database to which the table belongs. |
| TABLE_NAME | varchar(256) | NO | Table name |
| PARTITION_NAME | varchar(64) | NO | Partition name |
| SUBPARTITION_NAME | varchar(64) | NO | Subpartition name |
| TABLEGROUP_NAME | varchar(128) | NO | Table group name |
| DATABASE_ID | bigint(20) | NO | The ID of the database to which the table belongs. |
| TABLEGROUP_ID | bigint(20) | NO | Table group ID |
| OBJECT_ID | bigint(20) | NO | Object ID of the table |
Sample query
Users can query partitions with special weights set under the current tenant.
obclient[oceanbase]> SELECT * FROM oceanbase.DBA_OB_OBJECT_BALANCE_WEIGHT;
The query result is as follows:
+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
| TABLE_ID | PARTITION_ID | SUBPARTITION_ID | WEIGHT | DATABASE_NAME | TABLE_NAME | PARTITION_NAME | SUBPARTITION_NAME | TABLEGROUP_NAME | DATABASE_ID | TABLEGROUP_ID | OBJECT_ID |
+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
| 500002 | NULL | NULL | 1 | test | tbl1_h | NULL | NULL | NULL | 500001 | NULL | 500002 |
| 500002 | 500003 | NULL | 2 | test | tbl1_h | p0 | NULL | NULL | 500001 | NULL | 500003 |
+----------+--------------+-----------------+--------+---------------+------------+----------------+-------------------+-----------------+-------------+---------------+-----------+
2 rows in set
