Overview
Displays the basic information of a tenant.
- When querying this view from the sys tenant, it displays information for all tenants, including the sys tenant, user-created tenants (user tenants), and the meta tenant. You can distinguish between tenant types based on the
TENANT_TYPEcolumn. - When querying this view from a user tenant, only information of the current tenant is displayed.
Columns
Column |
Type |
Nullable |
Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | Tenant ID:
|
| TENANT_NAME | varchar(128) | NO | Tenant name |
| TENANT_TYPE | varchar(4) | NO |
|
| CREATE_TIME | timestamp(6) | YES | Tenant creation time |
| MODIFY_TIME | timestamp(6) | YES | Information Update Time |
| PRIMARY_ZONE | varchar(128) | YES | Tenant Primary Zone |
| LOCALITY | varchar(4096) | NO | Tenant Replica Distribution Information |
| PREVIOUS_LOCALITY | varchar(4096) | NO | Locality information before the change:
|
| COMPATIBILITY_MODE | varchar(6) | NO |
|
| STATUS | varchar(64) | NO | Current tenant status:
|
| IN_RECYCLEBIN | varchar(3) | NO | Whether it is in the recycle bin:
|
| LOCKED | varchar(3) | NO | Lock status:
ALTER TENANT xxx LOCK|UNLOCK commands to affect field values |
| TENANT_ROLE | varchar(100) | NO | Cluster roles:
|
| SWITCHOVER_STATUS | varchar(100) | NO | SWITCHOVER Status:
|
| SWITCHOVER_EPOCH | bigint(20) | NO | Unique Identifier for SWITCHOVER/FAILOVER |
| SYNC_SCN | bigint(20) unsigned | NO | The version of the snapshot that has been synchronized for the current tenant. This parameter is meaningless for the sys tenant and meta tenant, and its value is NULL. |
| REPLAYABLE_SCN | bigint(20) unsigned | NO | The current tenant can replay snapshot versions, which is meaningless for the sys tenant and meta tenant, so it displays as NULL. |
| READABLE_SCN | bigint(20) unsigned | NO | The readable snapshot version of the current tenant. This parameter is meaningless for the sys tenant and meta tenant, and its value is NULL. |
| RECOVERY_UNTIL_SCN | bigint(20) unsigned | NO | Maximum restore point of the current tenant. This parameter is meaningless for the sys tenant and meta tenant, and its value is NULL. |
| LOG_MODE | varchar(100) | NO | Archive mode:
|
| ARBITRATION_SERVICE_STATUS | varchar(64) | NO | The status of the tenant's arbitration service. Valid values:
|
| UNIT_NUM | bigint(20) | NO | Each zone of the tenant UNIT_NUM Minimum value of |
| ZONE_UNIT_NUM_LIST | varchar(65536) | NO | Displays the number of units in each zone under a tenant. |
| COMPATIBLE | varchar(65536) | NO | Compatibility Version |
| MAX_LS_ID | bigint(20) | NO | The largest log stream ID that the tenant has ever had. For the system tenant and Meta tenant, this value is 1; for user tenants, it is the actual size. |
| RESTORE_DATA_MODE | varchar(128) | NO | The mode for restoring tenant data. Valid values:
|
| FLASHBACK_LOG_SCN | bigint(20) | NO | The point in time when log trimming was last performed for the tenant. After a failover, you can use an O&M command to trim the standby tenant's logs to this point in time, thereby connecting the original standby tenant of the primary tenant to the new primary tenant. |
| COMMENT | varchar(4096) | NO | Comments |
| PROTECTION_MODE | varchar(128) | NO | The protection mode of the current tenant. Currently, only MAXIMUM PERFORMANCE (Maximum performance) Protection mode. |
| PROTECTION_LEVEL | varchar(128) | NO | The protection level of the current tenant. Currently, only MAXIMUM PERFORMANCE (Maximum Performance) Protection Level. |
Sample query
You can view the basic information about the current 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-03-16 16:31:59.903787
MODIFY_TIME: 2026-03-16 16:32:05.881113
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: 1774943436763416000
REPLAYABLE_SCN: 1774943436763416000
READABLE_SCN: 1774943436763416000
RECOVERY_UNTIL_SCN: 4611686018427387903
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.6.0.0
MAX_LS_ID: 1001
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
PROTECTION_MODE: MAXIMUM PERFORMANCE
PROTECTION_LEVEL: MAXIMUM PERFORMANCE
1 row in set
References
Tenant Type