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 from the system tenant, the information of all tenants, including the system tenant, user-created tenants (user tenants), and the Meta tenant, is displayed. You can use the
TENANT_TYPEcolumn to distinguish the types of tenants. - When you query this view from a user tenant, only the 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 the tenant is in the recycle bin:
|
| LOCKED | varchar(3) | NO | Whether the tenant is locked:
ALTER TENANT xxx LOCK|UNLOCK command. |
| TENANT_ROLE | varchar(100) | NO | Cluster role:
NoteThis column is available starting with V4.1.0. |
| SWITCHOVER_STATUS | varchar(100) | NO | SWITCHOVER status:
NoteThis column is available starting with V4.1.0. |
| SWITCHOVER_EPOCH | bigint(20) | NO | Unique identifier for SWITCHOVER/FAILOVER
NoteThis column is available starting with V4.1.0. |
| SYNC_SCN | bigint(20) unsigned | NO | Snapshot version that has been synchronized for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL
NoteThis column is available starting with V4.1.0. |
| REPLAYABLE_SCN | bigint(20) unsigned | NO | Snapshot version that can be replayed for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL
NoteThis column is available starting with V4.1.0. |
| READABLE_SCN | bigint(20) unsigned | NO | Snapshot version that can be read for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL
NoteThis column is available starting with V4.1.0. |
| RECOVERY_UNTIL_SCN | bigint(20) unsigned | NO | Maximum recovery point for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL
NoteThis column is available starting with V4.1.0. |
| LOG_MODE | varchar(100) | NO | Archive mode:
NoteThis column is available starting with V4.1.0. |
| ARBITRATION_SERVICE_STATUS | varchar(64) | NO | Arbitration service status of the tenant. Valid values:
NoteThis column is available starting with V4.1.0. |
| UNIT_NUM | bigint(20) | NO | 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 of the tenant. After a failover, you can use the log stream ID to execute the log pruning command on the standby tenant to access the standby tenant of the original primary tenant to the new primary tenant.
NoteThis column is available starting with V4.4.1. |
| COMMENT | varchar(4096) | NO | The comment. |
Sample query
In the sys tenant, query the basic information of all tenants.
obclient(root@sys)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1
TENANT_NAME: sys
TENANT_TYPE: SYS
CREATE_TIME: 2026-01-07 15:06:23.115389
MODIFY_TIME: 2026-01-07 15:06:23.115389
PRIMARY_ZONE: RANDOM
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: NULL
REPLAYABLE_SCN: NULL
READABLE_SCN: NULL
RECOVERY_UNTIL_SCN: NULL
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.4.2.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT: system tenant
*************************** 2. row ***************************
TENANT_ID: 1001
TENANT_NAME: META$1002
TENANT_TYPE: META
CREATE_TIME: 2026-01-07 15:07:29.169646
MODIFY_TIME: 2026-01-07 15:07:35.175576
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: NULL
REPLAYABLE_SCN: NULL
READABLE_SCN: NULL
RECOVERY_UNTIL_SCN: NULL
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.4.2.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
*************************** 3. 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: 1768208302754851000
REPLAYABLE_SCN: 1768208302754851000
READABLE_SCN: 1768208302754851000
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:
*************************** 4. row ***************************
TENANT_ID: 1003
TENANT_NAME: META$1004
TENANT_TYPE: META
CREATE_TIME: 2026-01-07 15:07:39.123961
MODIFY_TIME: 2026-01-07 15:07:45.464339
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: NULL
REPLAYABLE_SCN: NULL
READABLE_SCN: NULL
RECOVERY_UNTIL_SCN: NULL
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
ZONE_UNIT_NUM_LIST: zone1:1
COMPATIBLE: 4.4.2.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
*************************** 5. row ***************************
TENANT_ID: 1004
TENANT_NAME: oracle001
TENANT_TYPE: USER
CREATE_TIME: 2026-01-07 15:07:39.123961
MODIFY_TIME: 2026-01-07 15:07:45.487566
PRIMARY_ZONE: zone1
LOCALITY: FULL{1}@zone1
PREVIOUS_LOCALITY: NULL
COMPATIBILITY_MODE: ORACLE
STATUS: NORMAL
IN_RECYCLEBIN: NO
LOCKED: NO
TENANT_ROLE: PRIMARY
SWITCHOVER_STATUS: NORMAL
SWITCHOVER_EPOCH: 0
SYNC_SCN: 1768208302955986000
REPLAYABLE_SCN: 1768208302955986000
READABLE_SCN: 1768208302855843000
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:
5 rows in set