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

    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.0
    iconOceanBase Database
    SQL - V 4.3.0
    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

    View the log synchronization progress

    Last Updated:2026-04-15 08:30:00  Updated
    share
    What is on this page
    Query the synchronization progress of standby tenants from the sys tenant
    Query the synchronization progress of a standby tenant from the standby tenant
    References

    folded

    share

    After a standby tenant enters the continuous synchronization mode, you can query the log synchronization progress of the standby tenant in real time to make timely adjustment.

    A primary tenant has at least one system log stream and one common log stream. A standby tenant has the same number of log streams as a primary tenant. The log synchronization progress of the standby tenant is the overall synchronization progress of multiple log streams.

    You can compare the synchronization time of different log streams in the same tenant. The overall synchronization progress of the standby tenant is the synchronization progress of the slowest log stream among all log streams.

    Query the synchronization progress of standby tenants from the sys tenant

    You can log on to the sys tenant to view the synchronization progress of all tenants or a specified tenant.

    1. Log on as the administrator to the sys tenant of the cluster where the standby tenant resides.

    2. Execute the following statement to view the synchronization progress of the specified standby tenant.

      SELECT TENANT_NAME, TENANT_ID, TENANT_ROLE, SCN_TO_TIMESTAMP(SYNC_SCN) 
      FROM oceanbase.DBA_OB_TENANTS WHERE TENANT_NAME = 'standby_tenant';
      

      The query result is as follows:

      +----------------+-----------+-------------+----------------------------+
      | TENANT_NAME    | TENANT_ID | TENANT_ROLE | SCN_TO_TIMESTAMP(SYNC_SCN) |
      +----------------+-----------+-------------+----------------------------+
      | standby_tenant |      1004 | STANDBY     | 2023-04-14 16:38:53.938774 |
      +----------------+-----------+-------------+----------------------------+
      1 row in set
      

      The SCN_TO_TIMESTAMP(SYNC_SCN) field in the query result displays the synchronization progress of the specified standby tenant. You can compare the displayed time with the current time. A large difference indicates that the synchronization progress of the standby tenant lags behind that of the primary tenant.

      For more information about the DBA_OB_TENANTS view, see DBA_OB_TENANTS.

    3. (Optional) If the synchronization progress of the standby tenant is slow, query the slowest log stream.

      SELECT LS_ID, SCN_TO_TIMESTAMP(END_SCN) FROM oceanbase.GV$OB_LOG_STAT WHERE TENANT_ID = 1004 AND ROLE = 'LEADER';
      

      The query result is as follows:

      +-------+----------------------------+
      | LS_ID | SCN_TO_TIMESTAMP(END_SCN)  |
      +-------+----------------------------+
      |     1 | 2023-04-14 16:42:34.249988 |
      |  1001 | 2023-04-14 16:42:34.295123 |
      +-------+----------------------------+
      

      The query result shows that the synchronization progress of log stream 1 is slow.

    Query the synchronization progress of a standby tenant from the standby tenant

    You can log on to a standby tenant and view its synchronization progress.

    1. Log on to the standby tenant as the administrator.

    2. Execute the following statement to view the synchronization progress of the standby tenant.

      • MySQL mode

        SELECT TENANT_NAME, TENANT_ROLE, SCN_TO_TIMESTAMP(SYNC_SCN) FROM oceanbase.DBA_OB_TENANTS;
        

        The query result is as follows:

        +----------------+-------------+----------------------------+
        | TENANT_NAME    | TENANT_ROLE | SCN_TO_TIMESTAMP(SYNC_SCN) |
        +----------------+-------------+----------------------------+
        | standby_tenant | STANDBY     | 2023-04-14 16:38:53.938774 |
        +----------------+-------------+----------------------------+
        
      • Oracle mode

        SELECT TENANT_NAME, TENANT_ROLE, SCN_TO_TIMESTAMP(SYNC_SCN) FROM SYS.DBA_OB_TENANTS;
        

        The query result is as follows:

        +----------------+-------------+------------------------------+
        | TENANT_NAME    | TENANT_ROLE | SCN_TO_TIMESTAMP(SYNC_SCN)   |
        +----------------+-------------+------------------------------+
        | standby_tenant | STANDBY     | 14-APR-23 16:38:53.938774 PM |
        +----------------+-------------+------------------------------+
        

      The SCN_TO_TIMESTAMP(SYNC_SCN) field in the query result displays the synchronization progress of the specified standby tenant. You can compare the displayed time with the current time. A large difference indicates that the synchronization progress of the standby tenant lags behind that of the primary tenant.

      For more information about the DBA_OB_TENANTS view, see DBA_OB_TENANTS (MySQL mode) and DBA_OB_TENANTS (Oracle mode).

    3. (Optional) If the synchronization progress of the standby tenant is slow, query the slowest log stream.

      • MySQL mode

        SELECT LS_ID, SCN_TO_TIMESTAMP(END_SCN) FROM oceanbase.GV$OB_LOG_STAT WHERE ROLE = 'LEADER';
        

        The query result is as follows:

        +-------+----------------------------+
        | LS_ID | SCN_TO_TIMESTAMP(END_SCN)  |
        +-------+----------------------------+
        |     1 | 2023-04-14 16:42:34.249988 |
        |  1001 | 2023-04-14 16:42:34.295123 |
        +-------+----------------------------+
        
      • Oracle mode

        SELECT LS_ID, SCN_TO_TIMESTAMP(END_SCN) FROM SYS.GV$OB_LOG_STAT WHERE ROLE = 'LEADER';
        

        The query result is as follows:

        +-------+-----------------------------+
        | LS_ID | SCN_TO_TIMESTAMP(END_SCN)   |
        +-------+-----------------------------+
        |     1 | 14-APR-23 16:42:34.249988 PM|
        |  1001 | 14-APR-23 16:42:34.295123 PM|
        +-------+-----------------------------+
        

      The query result shows that the synchronization progress of log stream 1 is slow.

    References

    Optimize the log synchronization performance

    Previous topic

    View log restore source information
    Last

    Next topic

    Pause or resume log synchronization
    Next
    What is on this page
    Query the synchronization progress of standby tenants from the sys tenant
    Query the synchronization progress of a standby tenant from the standby tenant
    References