Note
- Due to the storage architecture optimization of OceanBase Database V4.x, this view has been deprecated since OceanBase Database V4.0.0.
- In OceanBase Database V4.x, you can query the DBA_OB_UNITS or GV$OB_UNITS view for the units of OBServer nodes in a cluster.
Purpose
The GV$UNIT view displays the metadata of all units in the cluster.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| unit_id | bigint(20) | NO | The ID of the unit. |
| unit_config_id | bigint(20) | NO | The ID of the unit config. |
| unit_config_name | varchar(128) | NO | The name of the unit config. |
| resource_pool_id | bigint(20) | NO | The ID of the resource pool. |
| resource_pool_name | varchar(128) | NO | The name of the resource pool. |
| zone | varchar(128) | NO | The zone to which the unit belongs. |
| tenant_id | bigint(20) | NO | The ID of the tenant. |
| tenant_name | varchar(128) | NO | The name of the tenant. |
| svr_ip | varchar(32) | NO | The IP address of the OBServer node. |
| svr_port | bigint(20) | NO | The port number of the OBServer node. |
| migrate_from_svr_ip | varchar(32) | NO | The IP address of the source OBServer node from which the unit was migrated. |
| migrate_from_svr_port | bigint(20) | NO | The port number of the source OBServer node from which the unit was migrated. |
| max_cpu | double | NO | The maximum number of vCPU cores. |
| min_cpu | double | NO | The minimum number of vCPU cores. |
| max_memory | bigint(20) | NO | The maximum memory size, in bytes. |
| min_memory | bigint(20) | NO | The minimum memory size, in bytes. |
| max_iops | bigint(20) | NO | The maximum IOPS. |
| min_iops | bigint(20) | NO | The minimum IOPS. |
| max_disk_size | bigint(20) | NO | The maximum disk size, in bytes. |
| max_session_num | bigint(20) | NO | The maximum number of sessions allowed. |
Sample query
Query the units on all OBServer nodes in the current cluster.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$UNIT;
The query result is as follows:
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+----------------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
| unit_id | unit_config_id | unit_config_name | resource_pool_id | resource_pool_name | zone | tenant_id | tenant_name | svr_ip | svr_port | migrate_from_svr_ip | migrate_from_svr_port | max_cpu | min_cpu | max_memory | min_memory | max_iops | min_iops | max_disk_size | max_session_num |
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+----------------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
| 1 | 1 | sys_unit_config | 1 | sys_pool | zone1 | 1 | sys | 11.xxx.xxx.xxx | 28823 | | 0 | 5 | 2.5 | 8053063680 | 6710886400 | 10000 | 5000 | 214748364800 | 9223372036854775807 |
| 1001 | 1001 | unit001 | 1001 | pool001 | zone1 | 1001 | mysql001 | 11.xxx.xxx.xxx | 28823 | | 0 | 1 | 1 | 5368709120 | 5368709120 | 128 | 128 | 32212254720 | 64 |
| 1002 | 1001 | unit001 | 1002 | pool002 | zone1 | 1002 | oracle001 | 11.xxx.xxx.xxx | 28823 | | 0 | 1 | 1 | 5368709120 | 5368709120 | 128 | 128 | 32212254720 | 64 |
+---------+----------------+------------------+------------------+--------------------+-------+-----------+-------------+----------------+----------+---------------------+-----------------------+---------+---------+------------+------------+----------+----------+---------------+---------------------+
3 rows in set