Note
- Due to the architectural optimization of the tenant management feature in V4.x, this view is no longer applicable to V4.x and has been removed starting from V4.0.0.
- In V4.x, you can query the DBA_OB_TENANTS view to view the details of both system tenants and user tenants.
Purpose
This view displays the details of all tenants in the 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 information of the tenant. |
| info | varchar(4096) | NO | The information of the tenant. |
| read_only | bigint(20) | NO | Whether the tenant is in read-only mode. This column is deprecated. |
| locality | varchar(256) | NO | The replica distribution mode of the tenant. |
Sample query
Query the details of 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
