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 Diagnostic Tool

V1.4.0

  • Overview
  • Install obdiag
  • Configure obdiag
  • Use `obdiag gather` commands to collect diagnostic information of OceanBase Database
  • Use `obdiag analyze` commands to analyze diagnostic information of OceanBase Database
  • Use `obdiag check` commands to inspect an OceanBase cluster
  • FAQ

Download PDF

Overview Install obdiag Configure obdiag Use `obdiag gather` commands to collect diagnostic information of OceanBase Database Use `obdiag analyze` commands to analyze diagnostic information of OceanBase Database Use `obdiag check` commands to inspect an OceanBase cluster FAQ
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 Diagnostic Tool
  3. V1.4.0
iconOceanBase Diagnostic Tool
V 1.4.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
  • V 3.3.0
  • V 3.2.0
  • V 3.1.0
  • V 3.0.0
  • V 2.6.0
  • V 2.5.0
  • V 2.4.0
  • V 2.3.0
  • V 1.5.0
  • V 1.4.0

Use `obdiag analyze` commands to analyze diagnostic information of OceanBase Database

Last Updated:2026-04-13 12:22:17  Updated
Share
What is on this page
analyze commands
Syntax
obdiag analyze log

folded

Share

If OceanBase Diagnostic Tool (obdiag) is independently deployed, you can use obdiag analyze commands to analyze diagnostic information of OceanBase Database. These commands allow you to analyze OceanBase Database logs to identify errors that have occurred.

If your OceanBase cluster is deployed by using OceanBase Deployer (OBD), you can run obdiag commands on OBD to collect diagnostic information of the cluster. For more information about the commands, see obdiag commands.

analyze commands

Syntax

obdiag analyze <gather type> [options]

Valid values of the analyze type parameter are as follows:

  • log: analyzes logs of the specified OceanBase cluster.

obdiag analyze log

You can run this command to analyze logs of the specified OceanBase cluster in online mode, or use the --files parameter to enable the offline analysis mode.

Note

  • In online analysis mode, the OceanBase cluster is in the running state, and the logs are distributed on each OBServer node.
  • In offline analysis mode, the command with the --files parameter collects the logs on the OBServer node to the server where obdiag is deployed.
  • Before you use this command, make sure that you have configured the logon information of the target nodes in the config.yml configuration file of obdiag. For more information, see Configure obdiag.
obdiag analyze log [options]

The following table describes the options.

Option
Required?
Data type
Default value
Description
--from No string Empty The start time for log collection in the yyyy-mm-dd hh:mm:ss format. The double quotation marks (") are not required. For example, you can set the start time as1970-01-01 12:00:00.
--to No string Empty The end time for log collection in the yyyy-mm-dd hh:mm:ss format. The double quotation marks (") are not required. For example, you can set the end time as 1970-01-01 13:00:00.
--since No string Empty The most recent period for which logs are collected, in the \<n> <m\|h\|d>format, where n is a number, m indicates minutes, h indicates hours, and d indicates days. For example, 30m specifies to analyze logs of the last 30 minutes.
--scope No string all The type of logs to be analyzed. Valid values:observer, election, rootservice, and all.
--grep No string Empty The search keyword.
--ob_install_dir No string /home/admin The installation directory of OceanBase Database.
--store_dir No string Current path in which the command is executed The local path where the results are stored.
--log_level No string WARN The levels of the logs to be analyzed. Valid values: DEBUG, TRACE, INFO, WDIAG, WARN, EDIAG, and ERROR from high to low. Logs of the specified level and higher are analyzed.
--files No string Empty The offline log analysis mode. If you specify --files, you must transfer OceanBase logs or pass the log path for offline analysis, and you do not need to specify the --from, --to, --since, and --ob_install_dir options.
  • Example of online log analysis

    obdiag analyze log --scope observer --from 2023-10-08 10:25:00 --to 2023-10-08 11:30:00
    
    ...
    FileListInfo:
    +----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | Node           | LogList                                                                                                                                                                                                               |
    +================+=======================================================================================================================================================================================================================+
    | xx.xx.xx.xx   | ['observer.log.20231008104204260', 'observer.log.20231008111305072', 'observer.log.20231008114410668', 'observer.log.wf.20231008104204260', 'observer.log.wf.20231008111305072', 'observer.log.wf.20231008114410668'] |
    +----------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    ...
    
    
    Analyze OceanBase Online Log Summary:
    +----------------+-----------+------------------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | Node           | Status    | FileName                                                                     |   ErrorCode | Message                                                                                                                       |   Count |
    +================+===========+==============================================================================+=============+===============================================================================================================================+=========+
    | xx.xx.xx.xx    | Completed | analyze_pack_20231008171201/xx_xx_xx_xx/observer.log.20231008104204260       |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |       2 |
    +----------------+-----------+------------------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | xx.xx.xx.xx    | Completed | analyze_pack_20231008171201/xx_xx_xx_xx/observer.log.20231008111305072       |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |       8 |
    +----------------+-----------+------------------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | xx.xx.xx.xx    | Completed | analyze_pack_20231008171201/xx_xx_xx_xx/observer.log.20231008114410668       |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |      10 |
    +----------------+-----------+------------------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | xx.xx.xx.xx    | Completed | analyze_pack_20231008171201/xx_xx_xx_xx/observer.log.20231008114410668       |       -4009 | IO error                                                                                                                      |      20 |
    +----------------+-----------+------------------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    For more details, please run cmd 'cat analyze_pack_20231008171201/result_details.txt'
    
    • Analyze logs of the most recent period:

      # Analyze the logs of the last hour in online mode. When this command is executed, the logs of the last hour are pulled from the remote host for analysis and error diagnosis.
      obdiag gather log --scope observer --since 1h
      
      
      # Analyze the logs of the last 30 minutes in online mode. When this command is executed, the logs of the last 30 minutes are pulled from the remote host for analysis and error diagnosis.
      obdiag analyze log --scope observer --since 30m
      
  • Example of offline log analysis

    $ ls -lh test/
    -rw-r--r--  1 admin  staff   256M Oct  8 17:24 observer.log.20231008104204260
    -rw-r--r--  1 admin  staff   256M Oct  8 17:24 observer.log.20231008111305072
    -rw-r--r--  1 admin  staff   256M Oct  8 17:24 observer.log.20231008114410668
    -rw-r--r--  1 admin  staff    18K Oct  8 17:24 observer.log.wf.20231008104204260
    -rw-r--r--  1 admin  staff    19K Oct  8 17:24 observer.log.wf.20231008111305072
    -rw-r--r--  1 admin  staff    18K Oct  8 17:24 observer.log.wf.20231008114410668
    
    $ obdiag analyze log --files test/
    
    Analyze OceanBase Offline Log Summary:
    +-----------+-----------+-----------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | Node      | Status    | FileName                                                              |   ErrorCode | Message                                                                                                                       |   Count |
    +===========+===========+=======================================================================+=============+===============================================================================================================================+=========+
    | 127.0.0.1 | Completed | analyze_pack_20231008172144/127_0_0_1_/observer.log.20231008104204260 |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |       2 |
    +-----------+-----------+-----------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | 127.0.0.1 | Completed | analyze_pack_20231008172144/127_0_0_1_/observer.log.20231008111305072 |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |       8 |
    +-----------+-----------+-----------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | 127.0.0.1 | Completed | analyze_pack_20231008172144/127_0_0_1_/observer.log.20231008114410668 |       -5006 | You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use |      10 |
    +-----------+-----------+-----------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    | 127.0.0.1 | Completed | analyze_pack_20231008172144/127_0_0_1_/observer.log.20231008114410668 |       -4009 | IO error                                                                                                                      |      20 |
    +-----------+-----------+-----------------------------------------------------------------------+-------------+-------------------------------------------------------------------------------------------------------------------------------+---------+
    For more details, please run cmd 'cat analyze_pack_20231008172144/result_details.txt'
    
    • Offline analysis of logs on a specified OBServer node:

      # Analyze the specified log file in offline mode
      obdiag analyze log --files observer.log.20230831142211247
      

Previous topic

Use `obdiag gather` commands to collect diagnostic information of OceanBase Database
Last

Next topic

Use `obdiag check` commands to inspect an OceanBase cluster
Next
What is on this page
analyze commands
Syntax
obdiag analyze log