Note
This view was introduced in OceanBase Database V4.0.0.
Purpose
The GV$OB_UNITS view displays the information about the units on the OBServer nodes where the current tenant reside. You can view the units of all OBServer nodes in the current cluster from the sys tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | The IP address of the OBServer node. |
| SVR_PORT | bigint(20) | NO | The port number of the OBServer node. |
| UNIT_ID | bigint(20) | NO | The ID of the unit. |
| TENANT_ID | bigint(20) | NO | The ID of the tenant to which the unit belongs. |
| ZONE | varchar(128) | NO | The name of the zone. |
| ZONE_TYPE | varchar(128) | NO | The type of the zone to which the unit belongs. Valid values:
NoteThis column was introduced in OceanBase Database V4.2.0. |
| REGION | varchar(128) | NO | The name of the region where the zone of the unit resides. If no region is specified, this column shows default_region by default. The value NULL indicates that the value of this column is invalid. The column value is invalid when the OBServer node is restarted.
NoteThis column was introduced in OceanBase Database V4.2.0. |
| MAX_CPU | double | NO | The maximum number of CPU cores. |
| MIN_CPU | double | NO | The minimum number of CPU cores. |
| MEMORY_SIZE | bigint(20) | NO | The memory size, in bytes. |
| MAX_IOPS | bigint(20) | NO | The maximum disk IOPS. |
| MIN_IOPS | bigint(20) | NO | The minimum disk IOPS. |
| IOPS_WEIGHT | bigint(20) | NO | The IOPS weight. |
| LOG_DISK_SIZE | bigint(20) | NO | The size of the log disk, in bytes. |
| LOG_DISK_IN_USE | bigint(20) | NO | The size of used space of the log disk, in bytes. |
| DATA_DISK_IN_USE | bigint(20) | NO | The size of used space of the data disk, in bytes. |
| STATUS | varchar(64) | NO | The status of the unit. Valid values: NORMAL: The unit is normal.MIGRATING IN: Data is being migrated into the unit.MIGRATING OUT: Data is being migrated out of the unit.MARK DELETING: The unit is marked as deleted.WAIT GC: The unit is waiting for garbage collection (GC).DELETING: GC has been completed, and the unit is being deleted.ERROR: An error occurred. |
| CREATE_TIME | timestamp(6) | NO | The time when the unit was created on the OBServer node. |
| REPLICA_TYPE | varchar(7) | NO | The type of the replica. The default value is FULL.
NoteThe |
Sample query
Query the information about the units of the tenant with tenant ID 1002 on all OBServer nodes from the sys tenant.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.GV$OB_UNITS WHERE TENANT_ID=1002\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: xxx.xx.xxx.239
SVR_PORT: 2882
UNIT_ID: 1001
TENANT_ID: 1002
ZONE: zone1
ZONE_TYPE: ReadWrite
REGION: default_region
MAX_CPU: 1
MIN_CPU: 1
MEMORY_SIZE: 4294967296
MAX_IOPS: 9223372036854775807
MIN_IOPS: 9223372036854775807
IOPS_WEIGHT: 1
LOG_DISK_SIZE: 14495514624
LOG_DISK_IN_USE: 198798112
DATA_DISK_IN_USE: 0
STATUS: NORMAL
CREATE_TIME: 2025-10-15 11:13:02.088335
REPLICA_TYPE: FULL
*************************** 2. row ***************************
SVR_IP: xxx.xx.xxx.198
SVR_PORT: 2882
UNIT_ID: 1003
TENANT_ID: 1002
ZONE: zone3
ZONE_TYPE: ReadWrite
REGION: default_region
MAX_CPU: 1
MIN_CPU: 1
MEMORY_SIZE: 4294967296
MAX_IOPS: 9223372036854775807
MIN_IOPS: 9223372036854775807
IOPS_WEIGHT: 1
LOG_DISK_SIZE: 14495514624
LOG_DISK_IN_USE: 198798112
DATA_DISK_IN_USE: 0
STATUS: NORMAL
CREATE_TIME: 2025-10-15 11:13:02.088249
REPLICA_TYPE: FULL
*************************** 3. row ***************************
SVR_IP: xxx.xx.xxx.201
SVR_PORT: 2882
UNIT_ID: 1002
TENANT_ID: 1002
ZONE: zone2
ZONE_TYPE: ReadWrite
REGION: default_region
MAX_CPU: 1
MIN_CPU: 1
MEMORY_SIZE: 4294967296
MAX_IOPS: 9223372036854775807
MIN_IOPS: 9223372036854775807
IOPS_WEIGHT: 1
LOG_DISK_SIZE: 14495514624
LOG_DISK_IN_USE: 198798112
DATA_DISK_IN_USE: 0
STATUS: NORMAL
CREATE_TIME: 2025-10-15 11:13:02.088368
REPLICA_TYPE: FULL
3 rows in set