Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
This view displays the basic information of tenants.
- When you query this view from the system tenant, information about all tenants, including system tenants, user tenants, and Meta tenants, is displayed. You can use the
TENANT_TYPEcolumn to distinguish between tenant types. - When you query this view from a user tenant, information about only the current tenant is displayed.
Purpose
| 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 creation time of the tenant. |
| 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 | Information about the distribution of tenant replicas. |
| PREVIOUS_LOCALITY | varchar(4096) | NO | The previous locality information.
|
| COMPATIBILITY_MODE | varchar(6) | NO |
|
| STATUS | varchar(64) | NO | The current status of the tenant.
|
| 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 statement. |
| TENANT_ROLE | varchar(100) | NO | The cluster role.
NoteThis column was introduced in V4.1.0. |
| SWITCHOVER_STATUS | varchar(100) | NO | The status of the SWITCHOVER operation.
NoteThis column was introduced in V4.1.0. |
| SWITCHOVER_EPOCH | bigint(20) | NO | The unique identifier of the SWITCHOVER/FAILOVER operation.
NoteThis column was introduced in V4.1.0. |
| SYNC_SCN | bigint(20) unsigned | NO | The highest snapshot version that has been synchronized to the tenant. For system tenants and Meta tenants, this value is NULL.
NoteThis column was introduced in V4.1.0. |
| REPLAYABLE_SCN | bigint(20) unsigned | NO | The highest snapshot version that can be replayed on the tenant. For system tenants and Meta tenants, this value is NULL.
NoteThis column was introduced in V4.1.0. |
| READABLE_SCN | bigint(20) unsigned | NO | The highest snapshot version that can be read on the tenant. For system tenants and Meta tenants, this value is NULL.
NoteThis column was introduced in V4.1.0. |
| RECOVERY_UNTIL_SCN | bigint(20) unsigned | NO | The highest recovery point of the tenant. For system tenants and Meta tenants, this value is NULL.
NoteThis column was introduced in V4.1.0. |
| LOG_MODE | varchar(100) | NO | The ARCHIVELOG mode.
NoteThis column was introduced in V4.1.0. |
| ARBITRATION_SERVICE_STATUS | varchar(64) | NO | The status of the arbitration service of the tenant. Valid values include:
NoteThis column was introduced in V4.1.0. |
| UNIT_NUM | bigint(20) | NO | The number of units in the zone.
NoteThis column was introduced in V4.2.0. |
| COMPATIBLE | varchar(65536) | NO | The compatibility version.
NoteThis column was introduced in V4.2.0. |
| MAX_LS_ID | bigint(20) | NO | The largest log stream ID that the tenant has ever had. For system tenants and Meta tenants, the value is 1. For user tenants, the value is the actual size.
NoteThis column was introduced in V4.2.0. |
| RESTORE_DATA_MODE | varchar(128) | NO | The mode for restoring data to the tenant. Valid values include:
NoteThis column was introduced in V4.3.3. |
Sample query
The system tenant queries the basic information of all tenants.
obclient [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: 2024-08-08 10:27:32.402236
MODIFY_TIME: 2024-08-08 10:27:32.402236
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
COMPATIBLE: 4.3.2.1
MAX_LS_ID: 1
RESTORE_DATA_MODE: NULL
*************************** 2. row ***************************
TENANT_ID: 1001
TENANT_NAME: META$1002
TENANT_TYPE: META
CREATE_TIME: 2024-08-08 10:28:21.351229
MODIFY_TIME: 2024-08-08 10:28:41.006972
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
COMPATIBLE: 4.3.2.1
MAX_LS_ID: 1
RESTORE_DATA_MODE: NULL
*************************** 3. row ***************************
TENANT_ID: 1002
TENANT_NAME: mysql001
TENANT_TYPE: USER
CREATE_TIME: 2024-08-08 10:28:21.355856
MODIFY_TIME: 2024-08-08 10:28:41.044814
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: 1723170391676016002
REPLAYABLE_SCN: 1723170391676016002
READABLE_SCN: 1723170391676016001
RECOVERY_UNTIL_SCN: 4611686018427387903
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
COMPATIBLE: 4.3.2.1
MAX_LS_ID: 1001
RESTORE_DATA_MODE: NORMAL
*************************** 4. row ***************************
TENANT_ID: 1003
TENANT_NAME: META$1004
TENANT_TYPE: META
CREATE_TIME: 2024-08-08 10:28:52.519229
MODIFY_TIME: 2024-08-08 10:29:14.862212
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
COMPATIBLE: 4.3.2.1
MAX_LS_ID: 1
RESTORE_DATA_MODE: NULL
*************************** 5. row ***************************
TENANT_ID: 1004
TENANT_NAME: oracle001
TENANT_TYPE: USER
CREATE_TIME: 2024-08-08 10:28:52.519229
MODIFY_TIME: 2024-08-08 10:29:14.902080
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: 1723170391676016001
REPLAYABLE_SCN: 1723170391676016001
READABLE_SCN: 1723170391676016001
RECOVERY_UNTIL_SCN: 4611686018427387903
LOG_MODE: NOARCHIVELOG
ARBITRATION_SERVICE_STATUS: DISABLED
UNIT_NUM: 1
COMPATIBLE: 4.3.2.1
MAX_LS_ID: 1001
RESTORE_DATA_MODE: NORMAL
5 rows in set