OceanBase
English日本語简体中文
Docs Home
Products
Integrations
Release Notes

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Databases

OceanBase DatabaseOceanBase Cloud OceanBase Best Practices

Connectors and Middleware

OceanBase Database Proxy OceanBase Connector/C OceanBase Connector/J OceanBase Connector/ODBC OceanBase Connector/NETOceanBase Command-Line Client

Tools

OceanBase Cloud PlatformOceanBase Migration ServiceOceanBase Developer CenterOceanBase Migration AssessmentOceanBase Admin ToolOceanBase Loader and DumperOceanBase DeployerKubernetes operator for OceanBaseOceanBase Diagnostic Tool OceanBase Binlog Service
OceanBase DatabaseOceanBase Cloud ToolsConnectors and MiddlewareLifecycle Support Policy

OceanBase Diagnostic Tool

V4.3.0
  • obdiag Overview
  • obdiag installation
  • obdiag configuration
  • One-click Cluster Inspection
    • One-click cluster inspection
    • Detailed explanation of cluster inspection indicators
  • One-click Information Gathering
    • One-click routine information collection
      • OceanBase cluster log collection
      • Host information collection
      • SQL details collection
      • Stack information collection
      • Flame Picture/Bian Que Picture Collection
      • ASH report collection
      • Collect table-related information
      • Cluster parameter collection
      • Variable collection
      • clog/slog collection
      • DBMS_XPLAN information collection
      • Core file collection
      • AWR report collection
      • obproxy log collection
      • OMS log collection
      • Collect all information
    • One-click scenario-based information collection
      • Overview
      • Collect basic cluster information
      • Collect backup problem information
      • Collect backup cleanup problem information
      • Collect clog disk full problem information
      • Collect cluster downtime problem information
      • Collect merge problem information
      • Collect CPU high problem information
      • Collect information on delay issues in primary and standby databases
      • Collect I/O problem information
      • Collect log archiving problem information
      • Collect long transaction problem information
      • Collect memory problem information
      • Collect SQL performance problem information
      • Collect PX error reporting information
      • Collect recovery problem information
      • Collect observer restart information without reason
      • Collect owner-cutting problem information
      • Collect information about hanging transaction issues
      • Collect copy imbalance problem information
      • Collect SQL error reporting information
      • Collect cluster TopSQL information
      • Collect application error information
      • Collect obproxy restart problem information for no reason
      • Collect ODP parameter information
      • Collect unspecified scenario problem information
  • One-click Diagnostic Analysis
    • One-click diagnostic analysis log
    • One-click full-link diagnostic log analysis
    • Parameter analysis (compared with default values)
    • Parameter analysis (parameter differences on different observers)
    • Analyze variables
    • Instructions for using index space analysis
    • One-click diagnostic analysis of memory
    • One-click diagnosis and analysis of queue backlog
  • One-click Root Cause Analysis
    • One-click root cause analysis
    • Root cause analysis scenario: disconnection
    • Root cause analysis scenario: card merging major_hold
    • Root cause analysis scenario: lock conflict lock_conflict
    • Root cause analysis scenario: executing DDL and reporting disk full error ddl_disk_full
    • Root cause analysis scenario: clog disk is full clog_disk_full
    • Root cause analysis scenario: log error log_error
    • Root cause analysis scenario: DDL failure ddl_failure
    • Root cause analysis scenario: Troubleshooting index build execution error index_ddl_error
    • Root cause analysis scenario: transaction disconnection scenario transaction_disconnection
    • Root cause analysis scenario: transaction execution times out and error transaction_execute_timeout
    • Root cause analysis scenario: transaction does not end and error transaction_not_ending is reported
    • Root cause analysis scenario: transaction other errors transaction_other_error
    • Root cause analysis scenario: transaction rollback error transaction_rollback
    • Root cause analysis scenario: transaction wait timeout error transaction_wait_timeout
    • Root cause analysis scenario: OMS full migration exception oms_full_trans
    • Root cause analysis scenario: OMS obcdc component analysis oms_obcdc
    • Root cause analysis scenario: suspended transaction suspend_transaction
    • Root cause analysis scenario: Unit GC exception unit_gc
    • Root cause analysis scenario: OceanBase cluster playback card
    • Root cause analysis scenario: OceanBase cluster memory explosion
    • Root cause analysis scenario: Abnormal deletion of OBServer node
    • Root cause analysis scenario: GC troubleshooting gc_troubleshooting
    • Root cause analysis scenario: Schema leak schema_leak
    • Root cause analysis scenario: partition split scheduling error split_schedule_error
    • Root cause analysis scenario: weak read problem troubleshooting weak_read_troubleshooting
    • Root cause analysis scenario: SQL execution memory is too high execute_memory_high
  • One-click Cluster Insights
    • Overview
    • Cluster overview information insights
    • Cluster node information insight
    • Cluster unit information insight
    • Cluster Zone Information Insights
    • Cluster RS Information Insights
    • Cluster tenant information insight
    • Cluster event information insight
    • Cluster lock information insight
    • Cluster topsql information insight
    • Cluster slowsql information insight
    • Cluster table information insight
    • Cluster processlist information insight
    • SQL execution plan information insights
    • Insights into database disk usage information
    • Insight on the disk usage of the specified table in the database
    • Insights into the full tenant information of the cluster
    • Cluster node CPU usage information insights
    • Internal table name fuzzy matching information insight
    • Cluster leader information insight
    • Information insights into locks held on a certain table
    • Cluster long transaction information information insight
    • Actual execution plan operator information insight
    • Memory information insights for all tenants
    • processlist Real-time session summary information insights
    • Table/index storage method information insight
    • Table NDV Information Insights
    • Table index information insight
    • Merge status display
    • clog log volume/capacity statistics
  • Plug-in file upgrade
  • Update and uninstall
  • Telemetry Mode
  • FAQ
  • Tools
    • Configuration file encryption
    • AI Intelligent Diagnosis Assistant
    • Disk IO performance detection
    • Configure verification tool
  • Release Notes
    • obdiag V4.2.0
    • obdiag V4.1.0
    • obdiag V4.0.0
    • obdiag V3.7.2
    • obdiag V3.7.1
    • obdiag V3.7.0
    • obdiag V3.6.0
    • obdiag V3.5.0
    • obdiag V3.4.0
    • obdiag V3.3.0
    • obdiag V3.2.0
    • obdiag V3.1.0
    • obdiag V3.0.0
    • obdiag V2.6.0
    • obdiag V2.5.0
    • obdiag V2.4.0
    • obdiag V2.3.0
    • obdiag V2.2.0
    • obdiag V2.1.0
    • obdiag V2.0.0
    • obdiag V1.6.2
    • obdiag V1.6.1
    • obdiag V1.6.0
    • obdiag V1.5.2
    • obdiag V1.5.1
    • obdiag V1.5.0
    • obdiag V1.4.0
    • obdiag V1.3.0

Download PDF

Document Feedback
  1. Documentation Center
  2. OceanBase Diagnostic Tool
  3. V4.3.0

Overview

Last Updated:2026-09-04 08:22:12

Prerequisites
View currently supported scenarios
obdiag gather scene run use
Usage example
Method 1: Use without configuration file (out of the box)
Method 2: Use with configuration file
Custom scene writing tutorial
Before starting to write

This article applies to the scenario of independently deploying obdiag. Using the obdiag gather command can help collect diagnostic information related to the OceanBase database. The scenes gather command can be executed with one click to retrieve the troubleshooting information required for certain problem scenarios, solving the pain point of difficulty in obtaining distributed node information.

Prerequisites

You need to ensure that the login information of the node to be collected has been configured in the obdiag configuration file config.yml. For related detailed configuration introduction, see obdiag configuration.

View currently supported scenarios

obdiag gather scene list

obdiag gather scene run use

obdiag gather scene run --scene={SceneName}

The options are explained below:

Option name
Is it required
Data type
Default value
Description
--scene Yes string Default is empty Scene name, you can use obdiag gather scene list to see which scenes the current version supports
--from No string Default is empty The start time of log collection, the format is: yyyy-mm-dd hh:mm:ss.

Explanation

If the obdiag used is a version before V2.0.0, there is no need to add quotation marks when configuring this option, otherwise an error will be reported. V2.0.0 and later versions no longer limit whether to include quotes when configuring this option.

--to No string Default is empty The end time of log collection, the format is: yyyy-mm-dd hh:mm:ss.

Explanation

If the obdiag used is a version before V2.0.0, there is no need to add quotation marks when configuring this option, otherwise an error will be reported. V2.0.0 and later versions no longer limit whether to include quotes when configuring this option.

--since No string 30m Log collection for a recent period of time, the format is: <n><m|h|d>, for example, 30m means collecting logs for the last 30 minutes.
--env No string Default is empty Some scenarios require additional parameters to support, which can be set through --env, format: --env key=value, which can be specified multiple times. For example: --env host=127.0.0.1 --env port=2881 --env user=test@test --env password=****** --env database=test. For specific configuration methods, please refer to the corresponding scenario introduction document.
--store_dir No string Defaults to the current path where the command is executed The local path where the results are stored.
--temp_dir No string /tmp The temporary file storage directory generated by the remote node during the collection process.
--skip_type No string Default is empty The collection type to be skipped, configurable values are ssh, sql. Use commas (,) to separate multiple values.
--redact No string Default is empty Select the OceanBase cluster log desensitization rule. For example, it can be configured as all_sql. When using multiple rules, use English commas (,) to separate them. To write the rules, refer to the introduction of this article [Preparing desensitization rules] (../100.normal/101.gather_log.md).
-c No string ~/.obdiag/config.yml Configuration file path.
--inner_config No string Default is empty obdiag Self-configuration, format: --inner_config key=value.
--config No string Default is empty Configuration of the cluster to be diagnosed by obdiag, fixed style: --config key1=value1 --config key2=value2.

Explanation

The parameters that support configuration through this option can be found in obdiag configuration.

--config_password No string Default is empty obdiag When using an encrypted configuration file, you need to pass in the corresponding password through this option. For details, see Configuration File Encryption.

Description

If the storage directory store_dir is not specified, the collected results will be stored in the gather_pack_xxxx folder in the current directory

Usage example

Method 1: Use without configuration file (out of the box)

obdiag gather scene run --scene={SceneName} \
    --config db_host=xx.xx.xx.xx \
    --config db_port=xxxx \
    --config tenant_sys.user=root@sys \
    --config tenant_sys.password=*** \
    --config obcluster.servers.nodes[0].ip=xx.xx.xx.1 \
    --config obcluster.servers.nodes[1].ip=xx.xx.xx.2 \
    --config obcluster.servers.nodes[2].ip=xx.xx.xx.3 \
    --config obcluster.servers.global.ssh_username=test \
    --config obcluster.servers.global.ssh_password=****** \
    --config obcluster.servers.global.home_path=/home/admin/oceanbase \
    --config obproxy.servers.nodes[0].ip=xx.xx.xx.3 \
    --config obproxy.servers.nodes[1].ip=xx.xx.xx.4 \
    --config obproxy.servers.global.ssh_username=test \
    --config obproxy.servers.global.ssh_password=****** \
    --config obproxy.servers.global.home_path=/home/admin/obproxy

Method 2: Use with configuration file

You need to ensure that the login information of the node to be collected has been configured in the obdiag configuration file config.yml. For related detailed configuration introduction, see obdiag configuration.

obdiag gather scene run --scene={SceneName}

Custom scene writing tutorial

A task represents an independent scenario, which can be understood as a professional script file written in yaml and recognized by obdiag.

Before starting to write

Before writing, you need to determine where the yaml needs to be placed.

You can first enter the directory identified by gather.scenes_base_path in the /opt/oceanbase-diagnostic-tool/conf/inner_config.yml file to see if the collection scene you wrote belongs to an existing category. If not, create a folder to declare this category.

Example:```

ssh script

cd ~/.obdiag/gather/tasks/observer touch test.yaml


The above completes the steps before writing

### Start writing

To start writing, start editing our test.yaml

```yaml
# Describe what this scenario does (human-readable summary)

info: "for test"

Simple content is over, complex writing begins, pay attention to details

Scene writing

The function of task is to declare the steps for scene collection execution. In order to be compatible with the differences in steps that may occur in different versions, its basic structure is a list.

The structure of an element of task is as follows

Parameter name
Is it required
Description
Data type
version No Indicates the applicable version, see the following example for usage Use the form of str to express the range, which requires a complete digital version number. The 3.
steps Yes The steps executed are list structures

The following is an example

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

steps is also a list, used to represent multiple specific execution processes.

The structure of an element of steps is a single process, as follows

Parameter name
Is it required
Description
type Yes indicates the applicable execution type. Currently, ssh/sql/log/obproxy_log/sysstat is supported, and supported types will continue to be added in the future
{ssh/sql/log/obproxy_log/sysstat} Yes Based on the parameters provided by the selected type, this section relies more on the logical description of the execution type in the code. This chapter will provide detailed instructions for the supported execution types later in this chapter

Examples of various types are as follows. "step:" is just a mark and has no actual effect.

ssh

Execute instructions remotely and obtain the corresponding return value

step:
  type: ssh
  ssh: wc -l /proc/${task_OBServer_pid}/maps | awk '{print $1}'
  global: false # Per-node: true runs once on first node only; false runs on every node
sql

Execute sql and get the corresponding value

step:
 type: sql
 sql: select tenant_name from oceanbase.__all_tenant;
 global: false
log

Collect logs from OceanBase database

step:
 type: log
 grep: "" # Filter pattern
 global: false
obproxy_log

Collect OBProxy logs

step:
 type: obproxy_log
 grep: "" # Filter pattern
 global: false
sysstat

Collect host information

step:
 type: sysstat
 sysstat: ""
 global: false
```<main id="notice" type='explain'>
  <h4>Description</h4>
  <p> The global field is relative to the node. When it is marked true, it will only be executed once when the first node is executed. If it is marked false, it will be executed on each node</p>
</main>

Previous topic

Collect all information
Last

Next topic

Collect basic cluster information
Next
on this page
Prerequisites
View currently supported scenarios
obdiag gather scene run use
Usage example
Method 1: Use without configuration file (out of the box)
Method 2: Use with configuration file
Custom scene writing tutorial
Before starting to write