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 from the system tenant, the information of all tenants, including the system tenant, user-created tenants (user tenants), and the Meta tenant, is displayed. You can use the TENANT_TYPE column to distinguish the types of tenants.
    • 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 Tenant ID:
    • 1: system tenant ID
    • Other values: user tenant or Meta tenant ID
    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 Tenant Primary Zone
    LOCALITY varchar(4096) NO Tenant replica distribution information
    PREVIOUS_LOCALITY varchar(4096) NO Locality information before the change:
    • If this value is valid, it indicates that the Locality change has not been 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 tenant status:
    • NORMAL: normal tenant
    • RESTORE: tenant being physically 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
    This value is affected by the ALTER TENANT xxx LOCK|UNLOCK command.
    TENANT_ROLE varchar(100) NO Cluster role:
    • PRIMARY: primary tenant
    • STANDBY: standby tenant
    • RESTORE: tenant being restored

    Note

    This column is available starting with V4.1.0.

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

    Note

    This column is available starting with V4.1.0.

    SWITCHOVER_EPOCH bigint(20) NO Unique identifier for SWITCHOVER/FAILOVER

    Note

    This column is available starting with V4.1.0.

    SYNC_SCN bigint(20) unsigned NO Snapshot version that has been synchronized for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL

    Note

    This column is available starting with V4.1.0.

    REPLAYABLE_SCN bigint(20) unsigned NO Snapshot version that can be replayed for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL

    Note

    This column is available starting with V4.1.0.

    READABLE_SCN bigint(20) unsigned NO Snapshot version that can be read for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL

    Note

    This column is available starting with V4.1.0.

    RECOVERY_UNTIL_SCN bigint(20) unsigned NO Maximum recovery point for the current tenant. For system tenants and Meta tenants, this column is meaningless and displays as NULL

    Note

    This column is available starting with V4.1.0.

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

    Note

    This column is available starting with V4.1.0.

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

    Note

    This column is available starting with V4.1.0.

    UNIT_NUM bigint(20) NO Minimum value of the UNIT_NUM of each zone of the tenant

    Note

    • This column is available starting with V4.2.0.
    • For V4.4.x, this column is available starting with V4.4.2, and the meaning of this column changes from "value of the UNIT_NUM of each zone of the tenant" to "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 column indicates the value of the UNIT_NUM of each zone of the tenant. For V4.2.5 BP5 and later, this column 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 was normally created or restored by using full data.
    • REMOTE: indicates that the tenant was restored by using rapid restore, 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 of the tenant. After a failover, you can use the log stream ID to execute the log pruning command on the standby tenant to access the standby tenant of the original primary 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 catch-up

    Note

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

    Sample query

    In the sys tenant, query the basic information of all tenants.

    obclient(root@sys)[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: 2026-04-14 15:38:30.683061
                   MODIFY_TIME: 2026-04-14 15:38:30.683061
                  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
            ZONE_UNIT_NUM_LIST: zone1:1
                    COMPATIBLE: 4.4.2.1
                     MAX_LS_ID: 1
             RESTORE_DATA_MODE: NORMAL
             FLASHBACK_LOG_SCN: NULL
                       COMMENT: system tenant
               PROTECTION_MODE: NULL
              PROTECTION_LEVEL: NULL
    *************************** 2. row ***************************
                     TENANT_ID: 1001
                   TENANT_NAME: META$1002
                   TENANT_TYPE: META
                   CREATE_TIME: 2026-04-14 15:39:02.777161
                   MODIFY_TIME: 2026-04-14 15:39:08.824143
                  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
            ZONE_UNIT_NUM_LIST: zone1:1
                    COMPATIBLE: 4.4.2.1
                     MAX_LS_ID: 1
             RESTORE_DATA_MODE: NORMAL
             FLASHBACK_LOG_SCN: NULL
                       COMMENT:
               PROTECTION_MODE: NULL
              PROTECTION_LEVEL: NULL
    *************************** 3. 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: 1776320969241849000
                REPLAYABLE_SCN: 1776320969241849000
                  READABLE_SCN: 1776320969241849000
            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
    *************************** 4. row ***************************
                     TENANT_ID: 1003
                   TENANT_NAME: META$1004
                   TENANT_TYPE: META
                   CREATE_TIME: 2026-04-14 15:39:12.843650
                   MODIFY_TIME: 2026-04-14 15:39:19.405907
                  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
            ZONE_UNIT_NUM_LIST: zone1:1
                    COMPATIBLE: 4.4.2.1
                     MAX_LS_ID: 1
             RESTORE_DATA_MODE: NORMAL
             FLASHBACK_LOG_SCN: NULL
                       COMMENT:
               PROTECTION_MODE: NULL
              PROTECTION_LEVEL: NULL
    *************************** 5. row ***************************
                     TENANT_ID: 1004
                   TENANT_NAME: oracle001
                   TENANT_TYPE: USER
                   CREATE_TIME: 2026-04-14 15:39:12.843650
                   MODIFY_TIME: 2026-04-14 15:39:19.418508
                  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: 1776320967535125000
                REPLAYABLE_SCN: 1776320967535125000
                  READABLE_SCN: 1776320967535125000
            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 PERFORMANCE
              PROTECTION_LEVEL: MAXIMUM PERFORMANCE
    5 rows in set
    

    References

    tenant type

    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