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 identify the tenant type. - When you query this view from a user tenant, information about only the current tenant is displayed.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| TENANT_ID | NUMBER(38) | NO | Tenant ID. Valid values:
|
| TENANT_NAME | VARCHAR2(128) | NO | Tenant name. |
| TENANT_TYPE | VARCHAR2(4) | NO |
|
| CREATE_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | Tenant creation time. |
| MODIFY_TIME | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | Information update time. |
| PRIMARY_ZONE | VARCHAR2(128) | YES | Primary zone of the tenant. |
| LOCALITY | VARCHAR2(4096) | YES | Information about the tenant's replicas. |
| PREVIOUS_LOCALITY | VARCHAR2(4096) | YES | Information about the tenant's replicas before the locality change was completed. Valid values:
|
| COMPATIBILITY_MODE | VARCHAR2(6) | NO |
|
| STATUS | VARCHAR2(64) | NO | Current status of the tenant. Valid values:
|
| IN_RECYCLEBIN | VARCHAR2(3) | NO | Whether the tenant is in the recycle bin. Valid values:
|
| LOCKED | VARCHAR2(3) | NO | Whether the tenant is locked. Valid values:
ALTER TENANT xxx LOCK|UNLOCK statement. |
| TENANT_ROLE | VARCHAR2(100) | NO | Cluster role. Valid values:
NoteThis column was introduced in V4.1.0. |
| SWITCHOVER_STATUS | VARCHAR2(100) | NO | Status of the switchover. Valid values:
NoteThis column was introduced in V4.1.0. |
| SWITCHOVER_EPOCH | NUMBER | NO | Unique identifier for a switchover or failover.
NoteThis column was introduced in V4.1.0. |
| SYNC_SCN | NUMBER | NO | The latest snapshot version synchronized to the tenant. This column is meaningless for system tenants and Meta tenants and displays NULL.
NoteThis column was introduced in V4.1.0. |
| REPLAYABLE_SCN | NUMBER | NO | The latest snapshot version that can be replayed on the tenant. This column is meaningless for system tenants and Meta tenants and displays NULL.
NoteThis column was introduced in V4.1.0. |
| READABLE_SCN | NUMBER | NO | The latest snapshot version that can be read on the tenant. This column is meaningless for system tenants and Meta tenants and displays NULL.
NoteThis column was introduced in V4.1.0. |
| RECOVERY_UNTIL_SCN | NUMBER | NO | The latest recovery point on the tenant. This column is meaningless for system tenants and Meta tenants and displays NULL.
NoteThis column was introduced in V4.1.0. |
| LOG_MODE | VARCHAR2(100) | NO | Archive mode. Valid values:
NoteThis column was introduced in V4.1.0. |
| ARBITRATION_SERVICE_STATUS | VARCHAR2(64) | NO | Status of the arbitration service of the tenant. Valid values:
NoteThis column was introduced in V4.1.0. |
| UNIT_NUM | NUMBER(38) | NO | Number of units in the zone.
NoteThis column was introduced in V4.2.0. |
| COMPATIBLE | VARCHAR2(65536) | NO | Compatibility version.
NoteThis column was introduced in V4.2.0. |
| MAX_LS_ID | NUMBER | NO | The maximum log stream ID that the tenant has ever had. Valid values:
NoteThis column was introduced in V4.2.0. |
| RESTORE_DATA_MODE | varchar(128) | NO | Mode for restoring data to the tenant. Valid values:
NoteThis column was introduced in V4.3.3. |
Sample query
The following example shows how to query the tenant information of the current user tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_OB_TENANTS\G
The query result is as follows:
*************************** 1. row ***************************
TENANT_ID: 1004
TENANT_NAME: oracle001
TENANT_TYPE: USER
CREATE_TIME: 08-AUG-24 10.28.52.519229 AM
MODIFY_TIME: 08-AUG-24 10.29.14.902080 AM
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: 1723169940678411001
REPLAYABLE_SCN: 1723169940678411001
READABLE_SCN: 1723169940678411000
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
1 row in set