OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.4.2

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.4.2
    iconOceanBase Database
    SQL - V 4.4.2
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    oceanbase.DBA_OB_TENANTS

    Last Updated:2026-04-24 04:04:05  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    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 the system tenant, the information of all tenants is displayed, including the system tenant, user-created tenant (user tenant), and Meta tenant. You can distinguish the tenant type based on the TENANT_TYPE column.
    • 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.
    • 1: the ID of the system tenant.
    • Other values: the ID of a user tenant or a Meta tenant.
    TENANT_NAME varchar(128) NO The tenant name.
    TENANT_TYPE varchar(4) NO
    • SYS: the system tenant.
    • USER: the user tenant.
    • META: the Meta tenant.
    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 distribution information of the tenant replicas.
    PREVIOUS_LOCALITY varchar(4096) NO The locality information before the change.
    • If this value is valid, it indicates that the locality change is not yet complete.
    • NULL indicates that no locality change has been performed.
    COMPATIBILITY_MODE varchar(6) NO
    • MYSQL: MySQL compatibility mode.
    • ORACLE: Oracle compatibility mode.
    STATUS varchar(64) NO The current tenant status.
    • NORMAL: normal status.
    • RESTORE: tenant being physically restored.
    • CREATING: tenant being created.
    • DROPPING: tenant being dropped.
    IN_RECYCLEBIN varchar(3) NO Indicates whether the tenant is in the recycle bin.
    • YES: the tenant is in the recycle bin.
    • NO: the tenant is not in the recycle bin.
    LOCKED varchar(3) NO Indicates whether the tenant is locked.
    • YES: the tenant is locked.
    • NO: the tenant is not locked.
    This field is affected by the ALTER TENANT xxx LOCK|UNLOCK statement.
    TENANT_ROLE varchar(100) NO The cluster role.
    • PRIMARY: primary tenant.
    • STANDBY: standby tenant.
    • RESTORE: tenant being restored.

    Note

    This field is available starting with V4.1.0.

    SWITCHOVER_STATUS varchar(100) NO The SWITCHOVER status.
    • NORMAL: normal status, not in the process of switching.
    • PREPARE SWITCHING TO PRIMARY: preparing for standby-to-primary switch.
    • SWITCHING TO PRIMARY: standby-to-primary switch.
    • PREPARE FLASHBACK: preparing for Flashback.
    • FLASHBACK: Flashback.
    • PREPARE SWITCHING TO STANDBY: preparing for primary-to-standby switch.
    • SWITCHING TO STANDBY: primary-to-standby switch.

    Note

    This field is available starting with V4.1.0.

    SWITCHOVER_EPOCH bigint(20) NO The unique identifier of SWITCHOVER/FAILOVER.

    Note

    This 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. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.

    Note

    This 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. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.

    Note

    This 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. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.

    Note

    This field is available starting with V4.1.0.

    RECOVERY_UNTIL_SCN bigint(20) unsigned NO The maximum recovery point for the current tenant. This field is not meaningful for the system tenant and Meta tenant, and is displayed as NULL.

    Note

    This field is available starting with V4.1.0.

    LOG_MODE varchar(100) NO The archive mode.
    • ARCHIVELOG: archive mode is enabled.
    • NOARCHIVELOG: archive mode is not enabled.

    Note

    This field is available starting with V4.1.0.

    ARBITRATION_SERVICE_STATUS varchar(64) NO The arbitration service status of the tenant. Valid values:
    • ENABLING: enabling.
    • ENABLED: enabled.
    • DISABLING: disabling.
    • DISABLED: disabled.

    Note

    This field is available starting with V4.1.0.

    UNIT_NUM bigint(20) NO The minimum value of the UNIT_NUM of each zone of the tenant.

    Note

    • This field is available starting with V4.2.0.
    • For V4.4.x, this field is available starting with V4.4.2, and the meaning of this field has changed from "the value of the UNIT_NUM of each zone of the tenant" to "the minimum value of the UNIT_NUM of each zone of the tenant".
    • In V4.2.5, for versions earlier than V4.2.5 BP5, this field indicates the value of the UNIT_NUM of each zone of the tenant. For V4.2.5 BP5 and later, this field indicates the minimum value of the UNIT_NUM of each zone of the tenant.
    ZONE_UNIT_NUM_LIST varchar(65536) NO This column displays the number of units in each zone of the tenant.

    Note

    • For V4.4.x, this column is available starting with V4.4.2.
    • For V4.2.5, this column is available starting with V4.2.5 BP5.
    COMPATIBLE varchar(65536) NO The compatibility version.

    Note

    This 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.

    Note

    This column is available starting with V4.2.0.

    RESTORE_DATA_MODE varchar(128) NO The data restore mode of the tenant. Valid values:
    • NORMAL: indicates that the tenant is normally created or restored from full data.
    • REMOTE: indicates that the tenant is quickly restored, and the data is in a remote reference state.

    Note

    This column is available starting with V4.3.2.

    FLASHBACK_LOG_SCN bigint(20) NO The latest log stream ID that has been executed in the tenant. After a failover, you can execute an operation command to perform log stream pruning on the standby tenant and then connect the standby tenant to the new primary tenant.

    Note

    This column is available starting with V4.4.1.

    COMMENT varchar(4096) NO The comment.
    PROTECTION_MODE varchar(128) NO The protection mode of the tenant. Valid values:
    • MAXIMUM PERFORMANCE: maximum performance.
    • MAXIMUM PROTECTION: maximum protection.
    • MAXIMUM AVAILABILITY: maximum availability.

    Note

    For V4.4.2, this column is available starting with V4.4.2 BP1.

    PROTECTION_LEVEL varchar(128) NO The protection level of the tenant. Valid values:
    • MAXIMUM PERFORMANCE: maximum performance.
    • MAXIMUM PROTECTION: maximum protection.
    • MAXIMUM AVAILABILITY: maximum availability.
    • RESYNCHRONIZATION: log synchronization.

    Note

    For V4.4.2, this column is available starting with V4.4.2 BP1.

    Sample query

    A user tenant queries the basic information of its own tenant.

    obclient(root@mysql001)[oceanbase]> SELECT * FROM oceanbase.DBA_OB_TENANTS\G
    

    The query result is as follows:

    *************************** 1. row ***************************
                     TENANT_ID: 1002
                   TENANT_NAME: mysql001
                   TENANT_TYPE: USER
                   CREATE_TIME: 2026-04-14 15:39:02.779988
                   MODIFY_TIME: 2026-04-14 15:39:08.838877
                  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: 1776319478085262
                      SYNC_SCN: 1776321403671313000
                REPLAYABLE_SCN: 1776321403671313000
                  READABLE_SCN: 1776321403671313000
            RECOVERY_UNTIL_SCN: 4611686018427387903
                      LOG_MODE: NOARCHIVELOG
    ARBITRATION_SERVICE_STATUS: DISABLED
                      UNIT_NUM: 1
            ZONE_UNIT_NUM_LIST: zone1:1
                    COMPATIBLE: 4.4.2.1
                     MAX_LS_ID: 1001
             RESTORE_DATA_MODE: NORMAL
             FLASHBACK_LOG_SCN: NULL
                       COMMENT:
               PROTECTION_MODE: MAXIMUM AVAILABILITY
              PROTECTION_LEVEL: MAXIMUM AVAILABILITY
    1 row in set
    

    References

    Types of tenants

    Previous topic

    oceanbase.DBA_OB_TENANT_EVENT_HISTORY
    Last

    Next topic

    oceanbase.DBA_OB_TEMP_FILES
    Next
    What is on this page
    Purpose
    Columns
    Sample query
    References