Note
This view is available starting with V4.0.0.
Purpose
This view displays the basic information of a tenant.
- When you query this view as the system tenant, the information of all tenants is displayed, including the system tenant, user-created tenant (user tenant), and Meta tenant. You can distinguish the tenant type based on the
TENANT_TYPEcolumn. - When you query this view as a user tenant, only the information of the current tenant is displayed.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID.
|
| TENANT_NAME | varchar(128) | NO | The tenant name. |
| TENANT_TYPE | varchar(4) | NO |
|
| CREATE_TIME | timestamp(6) | YES | The time when the tenant was created. |
| MODIFY_TIME | timestamp(6) | YES | The time when the information was last updated. |
| PRIMARY_ZONE | varchar(128) | YES | The primary zone of the tenant. |
| LOCALITY | varchar(4096) | NO | The distribution information of the tenant replicas. |
| PREVIOUS_LOCALITY | varchar(4096) | NO | The locality information before the change.
|
| COMPATIBILITY_MODE | varchar(6) | NO |
|
| STATUS | varchar(64) | NO | The current tenant status.
|
| IN_RECYCLEBIN | varchar(3) | NO | Indicates whether the tenant is in the recycle bin.
|
| LOCKED | varchar(3) | NO | Indicates whether the tenant is locked.
ALTER TENANT xxx LOCK|UNLOCK statement. |
| TENANT_ROLE | varchar(100) | NO | The cluster role.
NoteThis field is available starting with V4.1.0. |
| SWITCHOVER_STATUS | varchar(100) | NO | The SWITCHOVER status.
NoteThis field is available starting with V4.1.0. |
| SWITCHOVER_EPOCH | bigint(20) | NO | The unique identifier of SWITCHOVER/FAILOVER.
NoteThis field is available starting with V4.1.0. |
| SYNC_SCN | bigint(20) unsigned | NO | The snapshot version that has been synchronized for the current tenant. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.
NoteThis field is available starting with V4.1.0. |
| REPLAYABLE_SCN | bigint(20) unsigned | NO | The snapshot version that can be replayed for the current tenant. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.
NoteThis field is available starting with V4.1.0. |
| READABLE_SCN | bigint(20) unsigned | NO | The snapshot version that can be read for the current tenant. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.
NoteThis field is available starting with V4.1.0. |
| RECOVERY_UNTIL_SCN | bigint(20) unsigned | NO | The maximum recovery point for the current tenant. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.
NoteThis field is available starting with V4.1.0. |
| LOG_MODE | varchar(100) | NO | The archive mode.
NoteThis field is available starting with V4.1.0. |
| ARBITRATION_SERVICE_STATUS | varchar(64) | NO | The arbitration service status of the tenant. Valid values:
NoteThis field is available starting with V4.1.0. |
| UNIT_NUM | bigint(20) | NO | The minimum value of the UNIT_NUM of each zone of the tenant.
Note
|
| ZONE_UNIT_NUM_LIST | varchar(65536) | NO | This column displays the number of units in each zone of the tenant.
Note
|
| COMPATIBLE | varchar(65536) | NO | The compatibility version.
NoteThis column is available starting with V4.2.0. |
| MAX_LS_ID | bigint(20) | NO | The largest log stream ID that has ever existed in the tenant. For the system tenant and meta tenant, the value is 1. For a user tenant, the value is the actual size.
NoteThis column is available starting with V4.2.0. |
| RESTORE_DATA_MODE | varchar(128) | NO | The data restore mode of the tenant. Valid values:
NoteThis column is available starting with V4.3.2. |
| FLASHBACK_LOG_SCN | bigint(20) | NO | The latest log stream ID that has been executed in the tenant. After a failover, you can execute an operation command to perform log stream pruning on the standby tenant and then connect the standby tenant to the new primary tenant.
NoteThis column is available starting with V4.4.1. |
| COMMENT | varchar(4096) | NO | The comment. |
Sample query
A user tenant queries the basic information of its own tenant.
obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1002
TENANT_NAME: mysql001
TENANT_TYPE: USER
CREATE_TIME: 2026-01-07 15:07:29.173619
MODIFY_TIME: 2026-01-07 15:07:35.213500
PRIMARY_ZONE: zone1
LOCALITY: FULL{1}@zone1
PREVIOUS_LOCALITY: NULL
COMPATIBILITY_MODE: MYSQL
STATUS: NORMAL
IN_RECYCLEBIN: NO
LOCKED: NO
TENANT_ROLE: PRIMARY
SWITCHOVER_STATUS: NORMAL
SWITCHOVER_EPOCH: 0
SYNC_SCN: 1768208585642592000
REPLAYABLE_SCN: 1768208585642592000
READABLE_SCN: 1768208585441630000
RECOVERY_UNTIL_SCN: 4611686018427387903
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.4.2.0
MAX_LS_ID: 1001
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
1 row in set