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

    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.3.5
    iconOceanBase Database
    SQL - V 4.3.5
    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-09 02:53:56  Updated
    share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    share

    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_TYPE column to distinguish between tenant types.
    • When you query this view from a user tenant, information about only the tenant is displayed.

    Columns

    Column
    Type
    Nullable?
    Description
    TENANT_ID bigint(20) NO Tenant ID. Valid values include:
    • 1: ID of the system tenant.
    • Other values: ID of a user tenant or Meta tenant.
    TENANT_NAME varchar(128) NO Tenant name
    TENANT_TYPE varchar(4) NO
    • SYS: System tenant
    • USER: User tenant
    • META: Meta tenant
    CREATE_TIME timestamp(6) YES Tenant creation time
    MODIFY_TIME timestamp(6) YES Information update time
    PRIMARY_ZONE varchar(128) YES Primary zone of the tenant
    LOCALITY varchar(4096) NO Information about the distribution of tenant replicas
    PREVIOUS_LOCALITY varchar(4096) NO Information about the previous locality:
    • If this value is valid, the locality change is not completed.
    • 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 Current status of the tenant:
    • NORMAL: normal tenant
    • RESTORE: tenant being restored
    • CREATING: tenant being created
    • DROPPING: tenant being dropped
    IN_RECYCLEBIN varchar(3) NO Whether the tenant is in the recycle bin:
    • YES: in the recycle bin
    • NO: not in the recycle bin
    LOCKED varchar(3) NO Whether the tenant is locked:
    • YES: locked
    • NO: not locked
    The value of this column can be modified by running the ALTER TENANT xxx LOCK|UNLOCK statement.
    TENANT_ROLE varchar(100) NO Cluster role:
    • PRIMARY: primary tenant
    • STANDBY: standby tenant
    • RESTORE: tenant being restored

    Note

    Introduced in V4.1.0.

    SWITCHOVER_STATUS varchar(100) NO Status of the SWITCHOVER operation:
    • NORMAL: normal, not switching
    • PREPARE SWITCHING TO PRIMARY: preparing to switch to primary
    • SWITCHING TO PRIMARY: switching to primary
    • PREPARE FLASHBACK: preparing for Flashback
    • FLASHBACK: in Flashback mode
    • PREPARE SWITCHING TO STANDBY: preparing to switch to standby
    • SWITCHING TO STANDBY: switching to standby

    Note

    Introduced in V4.1.0.

    SWITCHOVER_EPOCH bigint(20) NO Unique identifier of the SWITCHOVER/FAILOVER operation

    Note

    Introduced in V4.1.0.

    SYNC_SCN bigint(20) unsigned NO The latest snapshot version synchronized by the tenant. For system tenants and Meta tenants, this column displays NULL.

    Note

    Introduced in V4.1.0.

    REPLAYABLE_SCN bigint(20) unsigned NO The latest snapshot version that can be replayed by the tenant. For system tenants and Meta tenants, this column displays NULL.

    Note

    Introduced in V4.1.0.

    READABLE_SCN bigint(20) unsigned NO The latest snapshot version that can be read by the tenant. For system tenants and Meta tenants, this column displays NULL.

    Note

    Introduced in V4.1.0.

    RECOVERY_UNTIL_SCN bigint(20) unsigned NO The latest recovery point of the tenant. For system tenants and Meta tenants, this column displays NULL.

    Note

    Introduced in V4.1.0.

    LOG_MODE varchar(100) NO Archival mode:
    • ARCHIVELOG: archival mode is being enabled.
    • NOARCHIVELOG: archival mode is disabled.

    Note

    Introduced in V4.1.0.

    ARBITRATION_SERVICE_STATUS varchar(64) NO Status of the arbitration service of the tenant, which can take on the following values:
    • ENABLING: enabling
    • ENABLED: enabled
    • DISABLING: disabling
    • DISABLED: disabled

    Note

    Introduced in V4.1.0.

    UNIT_NUM bigint(20) NO Number of units in the zone

    Note

    Introduced in V4.2.0.

    COMPATIBLE varchar(65536) NO Compatibility version

    Note

    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, this value is 1, and for user tenants, it is the actual size.

    Note

    Introduced in V4.2.0.

    RESTORE_DATA_MODE varchar(128) NO Mode for restoring data to the tenant. Valid values include:
    • NORMAL: the tenant is normally created or restored through full data restore.
    • REMOTE: the tenant is quickly restored, and the data is in a remote reference state.

    Note

    Introduced in V4.3.3.

    Sample query

    A user tenant queries the basic information of the tenant.

    obclient [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: 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: 1723170356638494000
                REPLAYABLE_SCN: 1723170356638494000
                  READABLE_SCN: 1723170356137986004
            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
    

    References

    Tenant types

    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