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

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive 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.1.0
    iconOceanBase Database
    SQL - V 4.1.0
    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

    log_tool

    Last Updated:2024-04-19 08:37:43  Updated
    Share
    What is on this page
    log_tool commands
    dump_log
    dump_filter
    stat

    folded

    Share

    Commit logs (clogs) in OceanBase Database are similar to redo logs in a conventional database. They persist the transaction data when transactions are committed. The transaction data is the record of transaction modifications to the database. log_tool parses and prints clog files. This topic describes how to use log_tool.

    log_tool is equivalent to clog_tool in earlier versions and is updated for adaptation in OceanBase Database V4.x. Specifically, some command formats are modified and some features are deleted.

    log_tool commands

    log_tool is integrated into ob_admin. You can run the ob_admin command to call log_tool. The following table describes the general commands of log_tool.

    Command
    Description
    dump_log Parses and prints the specified clog file.
    dump_tx_format Parses the specified clog file and prints the file in a format that is similar to SQL statements.
    dump_filter Parses the specified clog file and prints the log records that meet the specified conditions.
    stat Parses the specified clog file and prints the statistics of the file.

    dump_log

    ob_admin log_tool dump_log <clog_file_name>
    

    Usage notes:

    • You can run the dump_log command to parse and print the specified clog file. If you want to parse multiple files, separate the file names with spaces.

    • You must replace the clog_file_name string with the actual file name. The path of the file can be included in clog_file_name. Examples:

      • To parse and print a single clog file that is named 101 and located in the current directory, run the following command:

        ob_admin log_tool dump_log 101
        
      • To parse and print multiple clog files that are named 101 and 103 and located in the current directory, run the following command:

        ob_admin log_tool dump_log 101 103
        
      • To parse and print multiple clog files that are consecutively named 101, 102, 103, and 104 and located in the current directory, run the following command:

        ob_admin log_tool dump_log {101..104}
        

    dump_filter

    ob_admin log_tool dump_filter '<filter_name>' <clog_file_name>
    

    Usage notes:

    • You can use dump_filter to print the transaction-related content in clog files based on conditions.

    • For more information about <clog_file_name>, see dump_log.

    • You can filter log records by specifying filter conditions in the filter_name field. The following table describes the valid values of filter_name.

      Value
      Description
      tablet_id The ID of a data table.
      tx_id The ID of a transaction.

      You can specify one or multiple filter conditions in the filter_name field. If you specify multiple filter conditions, separate the conditions with semicolons (;). Examples:

      • Assume that tablet_id is set to 123, and the clog file is named 101 and located in the current directory. Run the following command to parse and print this clog file.

        ob_admin log_tool dump_filter 'tablet_id=123' 101
        
      • Assume that tablet_id is set to 123, tx_id is set to 26058724, and the clog file to be parsed is named 101 and located in the current directory. Run the following command to parse and print this clog file.

        ob_admin log_tool dump_filter 'tablet_id=123;tx_id=26058724' 101
        

    stat

    ob_admin log_tool stat <clog_file_name>
    

    Usage notes:

    • You can use the stat command to obtain statistics of the specified clog file, including the file size, number of records, and number of transactions.

      Note

      By using the CLOG_TOOL_BREAK_ON_FAIL environment variable, clog_tool can control whether to directly exit or ignore errors and continue. When CLOG_TOOL_BREAK_ON_FAIL is set to true, clog_tool directly exits. When CLOG_TOOL_BREAK_ON_FAIL is set to false, clog_tool ignores errors and continues parsing the specified clog file.

    • For more information about <clog_file_name>, see dump_log.

    Previous topic

    ob_admin overview
    Last

    Next topic

    Format of clogs
    Next
    What is on this page
    log_tool commands
    dump_log
    dump_filter
    stat