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 a system tenant, the information of all tenants is displayed, including system tenants, user-created tenants (user tenants), and the Meta tenant. You can distinguish the types of tenants 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 replica distribution information of the tenant. |
| PREVIOUS_LOCALITY | varchar(4096) | NO | The locality information before the change.
|
| COMPATIBILITY_MODE | varchar(6) | NO |
|
| STATUS | varchar(64) | NO | The current status of the tenant.
|
| 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 the 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. For the system tenant and Meta tenant, this field is meaningless 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. For the system tenant and Meta tenant, this field is meaningless 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. For the system tenant and Meta tenant, this field is meaningless 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. For the system tenant and Meta tenant, this field is meaningless 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 UNIT_NUM of all zones in the tenant.
Note
|
| ZONE_UNIT_NUM_LIST | varchar(65536) | NO | The number of units in each zone of the tenant.
Note
|
| COMPATIBLE | varchar(65536) | NO | The compatible version.
NoteThis column is available starting with V4.2.0. |
| MAX_LS_ID | bigint(20) | NO | The largest log stream ID that ever existed in the tenant. For the system tenant and the 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 was pruned from the tenant. After a failover, you can use the log stream pruning command to prune the logs of the original primary tenant to the specified log stream ID and then add the standby tenant to the new primary tenant.
NoteThis column is available starting with V4.4.1. |
| COMMENT | varchar(4096) | NO | The comment. |
| PROTECTION_MODE | varchar(128) | NO | The protection mode of the current tenant. Only MAXIMUM PERFORMANCE is supported.
NoteThis column is available starting with V4.6.0. |
| PROTECTION_LEVEL | varchar(128) | NO | The protection level of the current tenant. Only MAXIMUM PERFORMANCE is supported.
NoteThis column is available starting with V4.6.0. |
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-03-16 16:30:17.393164
MODIFY_TIME: 2026-03-16 16:30:17.393164
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.6.0.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT: system tenant
PROTECTION_MODE: NULL
PROTECTION_LEVEL: NULL
*************************** 2. row ***************************
TENANT_ID: 1001
TENANT_NAME: META$1002
TENANT_TYPE: META
CREATE_TIME: 2026-03-16 16:31:59.900666
MODIFY_TIME: 2026-03-16 16:32:05.858000
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.6.0.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
PROTECTION_MODE: NULL
PROTECTION_LEVEL: NULL
*************************** 3. 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: 1774942077352120000
REPLAYABLE_SCN: 1774942077352120000
READABLE_SCN: 1774942077252078000
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
*************************** 4. row ***************************
TENANT_ID: 1003
TENANT_NAME: META$1004
TENANT_TYPE: META
CREATE_TIME: 2026-03-16 16:32:16.239476
MODIFY_TIME: 2026-03-16 16:32:22.212696
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.6.0.0
MAX_LS_ID: 1
RESTORE_DATA_MODE: NORMAL
FLASHBACK_LOG_SCN: NULL
COMMENT:
PROTECTION_MODE: NULL
PROTECTION_LEVEL: NULL
*************************** 5. row ***************************
TENANT_ID: 1004
TENANT_NAME: oracle001
TENANT_TYPE: USER
CREATE_TIME: 2026-03-16 16:32:16.239476
MODIFY_TIME: 2026-03-16 16:32:22.233799
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: 1774942077252078000
REPLAYABLE_SCN: 1774942077252078000
READABLE_SCN: 1774942077252078000
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
5 rows in set
