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 check` commands to inspect an OceanBase cluster

Last Updated:2026-04-13 12:22:17  Updated
Share
What is on this page
Prerequisites
check commands
Syntax
Tutorial for writing a task
Preparation
Write a task script
About manual update of tasks

folded

Share

If OceanBase Diagnostic Tool (obdiag) is independently deployed, you can use obdiag check commands to inspect the status of an OceanBase cluster. The inspection process analyzes the cluster from perspectives of the system kernel parameters and internal tables, identifies the causes of existing or possible exceptions, and provides O&M suggestions.

Prerequisites

You have installed obdiag. For more information, see Install obdiag.

check commands

Syntax

obdiag check [options]

The following table describes the options.

Option
Required?
Data type
Default value
Description
--cases No string `` The items to be inspected. If this option is not specified, all inspection tasks are executed.

Here is an example:

obdiag check --cases=test

'cat ./check_report/check_report_2023-10-30-16:15:52.table', export type is table
For more details, please run cmd 'cat ./check_report/check_report_2023-10-30-16:15:52.table'
If you want to view detailed obdiag logs, please run:'obdiag display-trace --trace_id a7674ecb-0d99-36fe-b584-3b707b4647bc'

Tutorial for writing a task

A task is a script file written in YAML, which defines an independent inspection scenario.

Each task contains a forward declaration for professional inspection.

Preparation

Before you write a task script file, determine where you want to save it.

The script file must be saved in the CHECK.tasks_base_path directory specified in the config.yml file. Make sure that you have a folder in this directory to describe your inspection scenario.

Here is an example:

# Go to the `${CHECK.tasks_base_path}` directory, create a folder named `test`, and then create a sample task script file named `test.yaml`.
cd ~/.obdiag/tasks/
mkdir test
cd test
touch test.yaml

Write a task script

A task script declares a list of steps to be executed for inspection. Some inspection items may not be properly used or some steps may not be performed as expected in different OceanBase Database versions. In this case, you can include them in a task script.

Here is a sample task file:

info: testinfo
task:
  - obversion: "[3.1.0,3.2.4]"
    steps:
      {steps_object}
  - obversion: "[4.2.0.0,4.3.0.0]"
    steps:
      {steps_object}

The parameters are described as follows:

Parameter
Required?
Description
info Yes The scenario to use the task script file. This information facilitates maintenance.
obversion No The OceanBase Database version that the script is compatible with. The value is a range with complete version numbers in the form of a string.
  • The version number contains three digits for OceanBase Database V3.x, such as [3.1.1,3.2.0].
  • The version number contains four digits for OceanBase Database V4.x, such as [4.1.0.0,4.2.0.0].
steps Yes The steps to be executed, which are in a list structure.

About steps

steps is a list of multiple execution processes.

An element of steps is a single process that contains the following parameters:

Parameter
Required?
type Yes The applicable execution type. Valid values: get_system_parameter, ssh, and sql.
{parameter_name/ssh/sql} Yes The parameters for the selected type, which depend on the logic description of the execution type in the code.
result No An independent object that parses the operations to be performed after the current step ends, such as a verification result logic and the text information to be reported when the logic fails. For more information, see the description about the [result & verify](#result%20&%20verify%20 feature) field.

In the following examples, step: serves only as a mark and has no actual meaning.

  • get_system_parameter

    steps:
    - type: get_system_parameter
      parameter_name: parameter
      result:
        set_value: servervm.max_map_count
    
  • ssh

    Remotely execute the instruction and obtain the corresponding return value

    steps:
    - type: ssh
      ssh: wc -l /proc/${task_OBServer_pid}/maps | awk '{print $1}'
      result:
        set_value: observerMaps
    
  • sql

    Execute an SQL statement and obtain the corresponding value.

    steps:
    - type: sql
      sql: select tenant_name from oceanbase.table_name from where tenant_id=${taskTenantId};
      result:
        set_value: tenant_name
    
result & verify

This field is the main dependent field of the verify feature and is used to verify the task result.

The syntax is as follows:

result:
      set_value: {set_value}
      verify_type: {verify_type}
      report_type: {report_type}
      verify: {verify}
      err_msg: {err_msg}

The parameters are described as follows:

Parameter
Required
Description
set_value No The value to be assigned for the executed value as a variable that applies to the entire task, such as set_value: max_map_count.
verify_type No The verification method. The default value is base. In most cases, the verification method must be linked with the verify field. The base method uses a verify expression to generate a true or false result. Several general judgment types are provided after this table.
verify No Verifies whether the execution result meets the expectation of the verify_type and returns the err_msg information if the result fails the expectation.
report_type No The alert level to be executed if the verify result for this step is false. Default value: critical.
err_msg No The log used for recording execution errors. This parameter can be configured as a global variable. If the message output is configured with verify and the result of verify is false, an err_msg must be provided.

Judgment types supported by verify_type:

At present, the judgment types supported by verify_type apply only the base and int types.

  • between: checks whether the set_value value is within the range provided by verify.
  • max: checks whether the set_value value is less than the value provided by verify.
  • min: checks whether the set_value value is greater than the value provided by verify.
  • equal: checks whether the set_value value is equal to the value provided by verify.

About base

verify expressions are used to replace the verification in the following shell expression new_expr. When you write verify, you can manually verify the logic on a local server.

if ${new_expr}; then
    echo "true"
else
    echo "false"
fi

About manual update of tasks

To provide more effective inspection tasks, we will update these tasks from time to time. You can replace the ~/.obdiag/tasks folder and the ~/.obdiag/check_package.yaml with the tasks folder and the check_package.yaml file under the ${code_path}/handler/check directory in obdiag code repository to update them.

Previous topic

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

Next topic

FAQ
Next
What is on this page
Prerequisites
check commands
Syntax
Tutorial for writing a task
Preparation
Write a task script
About manual update of tasks