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_TENANTS view in the
systenant or a user tenant for the details about tenants.
Purpose
The gv$tenant view displays the details about all tenants in the current cluster.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| tenant_id | bigint(20) | NO | The ID of the tenant. |
| tenant_name | varchar(128) | NO | The name of the tenant. |
| zone_list | varchar(8192) | NO | The list of zones of the tenant. |
| primary_zone | varchar(128) | YES | The primary zone of the tenant. |
| collation_type | bigint(20) | NO | The collation type of the tenant. |
| info | varchar(4096) | NO | The information about the tenant. |
| read_only | bigint(20) | NO | Indicates whether the tenant is in real-only mode. This column has been deprecated. |
| locality | varchar(256) | NO | The locality of the tenant. |
Sample query
Query the details about all tenants in the current cluster.
obclient [oceanbase]> SELECT * FROM oceanbase.gv$tenant;
The query result is as follows:
+-----------+-------------+-----------+--------------+----------------+---------------+-----------+---------------+
| tenant_id | tenant_name | zone_list | primary_zone | collation_type | info | read_only | locality |
+-----------+-------------+-----------+--------------+----------------+---------------+-----------+---------------+
| 1 | sys | zone1 | zone1 | 0 | system tenant | 0 | FULL{1}@zone1 |
| 1001 | mysql001 | zone1 | zone1 | 0 | | 0 | FULL{1}@zone1 |
| 1002 | oracle001 | zone1 | zone1 | 0 | | 0 | FULL{1}@zone1 |
+-----------+-------------+-----------+--------------+----------------+---------------+-----------+---------------+
3 rows in set