Note
This view is available starting with V4.0.0.
Overview
Displays the basic information of a tenant.
- When querying this view through the system tenant, it displays information for all tenants, including the system tenant, user-created tenants (user tenants), and the Meta tenant. You can distinguish between tenant types based on the
TENANT_TYPEcolumn. - When you query 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|UNLOCKcommands to affect field values |
| TENANT_ROLE | varchar(100) | NO | Cluster roles:
NoteThis field is available starting with V4.1.0. |
| SWITCHOVER_STATUS | varchar(100) | NO | SWITCHOVER Status:
NoteThis field is available starting with V4.1.0. |
| SWITCHOVER_EPOCH | bigint(20) | NO | Unique identifier for the SWITCHOVER/FAILOVER operation.
NoteThis field is available starting with V4.1.0. |
| SYNC_SCN | bigint(20) unsigned | NO | The version of the snapshot that has been synchronized for the current tenant. This field is meaningless for the sys 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 current tenant can replay snapshot versions, which is meaningless for the system tenant and Meta tenant, so it displays as NULL.
NoteThis field is available starting with V4.1.0. |
| READABLE_SCN | bigint(20) unsigned | NO | The readable snapshot version of the current tenant. This field is meaningless for the sys 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 | Maximum restore point of the current tenant. This field is meaningless for the sys tenant and meta tenant, and is displayed as NULL.
NoteThis field is available starting with V4.1.0. |
| LOG_MODE | varchar(100) | NO | 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 | Each zone of the tenant'sUNIT_NUMMinimum Value of
Note
|
| ZONE_UNIT_NUM_LIST | varchar(65536) | NO | Displays the number of units in each zone of a tenant.
NoteThis field is available starting with V4.2.5 BP5. |
| COMPATIBLE | varchar(65536) | NO | Compatibility Version
NoteThis field is available starting with V4.2.0. |
| 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.
NoteThis field is available starting with V4.2.0. |
| FLASHBACK_LOG_SCN | bigint(20) | NO | The timestamp of the last log trimming for the tenant. After a failover, you can use an O&M command to trim the standby tenant's logs to this point and promote the original standby tenant to the new primary tenant.
NoteThis field is available starting with V4.2.5 BP4. |
Sample query
You can view the basic information about the current tenant.
obclient [oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1008
TENANT_NAME: tenant1
TENANT_TYPE: USER
CREATE_TIME: 2025-06-10 21:55:14.624399
MODIFY_TIME: 2025-06-16 14:00:40.691794
PRIMARY_ZONE: z1,z2
LOCALITY: FULL{1}@z1, FULL{1}@z2
PREVIOUS_LOCALITY: NULL
COMPATIBILITY_MODE: MYSQL
STATUS: NORMAL
IN_RECYCLEBIN: NO
LOCKED: NO
TENANT_ROLE: PRIMARY
SWITCHOVER_STATUS: NORMAL
SWITCHOVER_EPOCH: 0
SYNC_SCN: 1750060170009596000
REPLAYABLE_SCN: 1750060170009596000
READABLE_SCN: 1750060169907507000
RECOVERY_UNTIL_SCN: 4611686018427387903
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 2
ZONE_UNIT_NUM_LIST: z1:2,z2:2
COMPATIBLE: 4.2.5.5
MAX_LS_ID: 1018
FLASHBACK_LOG_SCN: NULL
1 row in set
