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

    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.3
    iconOceanBase Database
    SQL - V 4.3.3
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    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:2024-12-02 03:48:27  Updated
    Share
    What is on this page
    Purpose
    Columns
    Sample query
    References

    folded

    Share

    Note

    This view was introduced in OceanBase Database V4.0.0.

    Purpose

    The oceanbase.DBA_OB_TENANTS view displays the basic information of tenants.

    • When you query this view from the sys tenant, the view displays the basic information of all tenants, including the sys tenant, user tenants, and meta tenants. You can determine the tenant type based on the TENANT_TYPE column.
    • When you query this view from a user tenant, only the information of the current tenant is displayed.

    Columns

    Column
    Type
    Nullable?
    Description
    TENANT_ID bigint(20) NO The ID of the tenant. Valid values:
    • 1: indicates the ID of the sys tenant.
    • Other values: indicates the ID of a user tenant or meta tenant.
    TENANT_NAME varchar(128) NO The name of the tenant.
    TENANT_TYPE varchar(4) NO The type of the tenant. Valid values:
    • SYS: indicates the sys tenant.
    • USER: indicates a user tenant.
    • META: indicates a meta tenant.
    CREATE_TIME timestamp(6) YES The time when the tenant was created.
    MODIFY_TIME timestamp(6) YES The time when the tenant was last modified.
    PRIMARY_ZONE varchar(128) YES The primary zone of the tenant.
    LOCALITY varchar(4096) NO The locality of the tenant.
    PREVIOUS_LOCALITY varchar(4096) NO The locality before the change.
    • If this column has a valid value, the locality change is not completed.
    • The value NULL indicates that no locality change was performed.
    COMPATIBILITY_MODE varchar(6) NO The compatibility mode. Valid values:
    • MYSQL
    • ORACLE
    STATUS varchar(64) NO The current status of the tenant. Valid values:
    • NORMAL: The tenant is normal.
    • RESTORE: The tenant is undergoing physical restore.
    • CREATING: The tenant is being created.
    • DROPPING: The tenant is being dropped.
    IN_RECYCLEBIN varchar(3) NO Indicates whether the tenant has been dropped and is in the recycle bin. Valid values:
    • 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. Valid values:
    • YES: The tenant is locked.
    • NO: The tenant is not locked.
    The value of this column is controlled by the ALTER TENANT xxx LOCK\|UNLOCK command.
    TENANT_ROLE varchar(100) NO The role of the tenant in the cluster. Valid values:
    • PRIMARY: indicates a primary tenant.
    • STANDBY: indicates a standby tenant.
    • RESTORE: indicates that the tenant is being restored.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    SWITCHOVER_STATUS varchar(100) NO The switchover status. Valid values:
    • NORMAL: No switchover is performed for the current tenant.
    • PREPARE SWITCHING TO PRIMARY: The current tenant is preparing for a switchover to the primary tenant.
    • SWITCHING TO PRIMARY: The current tenant is being switched to the primary tenant.
    • PREPARE FLASHBACK: The current tenant is preparing for flashback.
    • FLASHBACK: The current tenant is in the flashback state.
    • PREPARE SWITCHING TO STANDBY: The current tenant is preparing for a switchover to a standby tenant.
    • SWITCHING TO STANDBY: The current tenant is being switched to a standby tenant.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    SWITCHOVER_EPOCH bigint(20) NO The unique ID of the switchover or failover.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    SYNC_SCN bigint(20) unsigned NO The snapshot version that has been synchronized for the current tenant. The value is NULL for the sys tenant or a meta tenant.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    REPLAYABLE_SCN bigint(20) unsigned NO The snapshot version that can be replayed for the current tenant. The value is NULL for the sys tenant or a meta tenant.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    READABLE_SCN bigint(20) unsigned NO The snapshot version that can be read for the current tenant. The value is NULL for the sys tenant or a meta tenant.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    RECOVERY_UNTIL_SCN bigint(20) unsigned NO The maximum system change number (SCN) that can be restored for the current tenant. The value is NULL for the sys tenant or a meta tenant.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    LOG_MODE varchar(100) NO The log archiving mode. Valid values:
    • ARCHIVELOG: Log archiving is enabled.
    • NOARCHIVELOG: Log archiving is not enabled.

    Note

    This column is available in OceanBase Database V4.1.0 and later.

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

    Note

    This column is available in OceanBase Database V4.1.0 and later.

    UNIT_NUM bigint(20) NO The number of resource units in each zone.

    Note

    This column is available in OceanBase Database V4.2.0 and later.

    COMPATIBLE varchar(65536) NO The compatibility version.

    Note

    This column is available in OceanBase Database V4.2.0 and later.

    MAX_LS_ID bigint(20) NO The maximum log stream ID of the tenant. The value is 1 for the sys tenant or a meta tenant. For a user tenant, the value varies based on the actual situation.

    Note

    This column is available in OceanBase Database V4.2.0 and later.

    RESTORE_DATA_MODE varchar(128) NO The data restore mode of the tenant. Valid values:
    • NORMAL: The tenant is normally created or restored from full data. This is the default value.
    • REMOTE: The tenant is restored in quick restore mode, and the baseline data is referenced from a remote source.

    Note

    This column is available in OceanBase Database V4.3.3 and later.

    Sample query

    Query the basic information of all tenants from the sys tenant.

    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
    

    References

    Tenant types

    Previous topic

    oceanbase.DBA_OB_TENANT_JOBS
    Last

    Next topic

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