OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

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

A unified distributed database ready for your transactional, analytical, and AI workloads.

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

V2.3.0

  • Overview
  • Install obdiag
  • Configure obdiag
  • One-click Cluster Inspection
    • Use obdiag to inspect an OceanBase cluster
    • Inspection metrics
  • One-click Information Gathering
    • Use obdiag to collect information
    • Use obdiag to collect information for specific scenarios
  • Use obdiag for Diagnostic Analysis
  • Use obdiag for Root Cause Analysis
  • Upgrade obdiag by Using add-on Files
  • Upgrade and Uninstall obdiag
  • Telemetry Mode
  • FAQ
  • Release Notes
    • 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

Overview Install obdiag Configure obdiag Use obdiag to inspect an OceanBase cluster Inspection metrics Use obdiag to collect information Use obdiag to collect information for specific scenarios Use obdiag for Diagnostic Analysis Use obdiag for Root Cause Analysis Upgrade obdiag by Using add-on Files Upgrade and Uninstall obdiag Telemetry Mode FAQ 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
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
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. V2.3.0
iconOceanBase Diagnostic Tool
V 2.3.0
  • 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 to collect information

Last Updated:2026-04-15 04:37:22  Updated
share
What is on this page
Prerequisites
Syntax of gather commands
obdiag gather log
obdiag gather sysstat
obdiag gather clog
obdiag gather slog
obdiag gather plan_monitor
obdiag gather stack
obdiag gather perf
obdiag gather obproxy_log
obdiag gather ash
obdiag gather tabledump
obdiag gather parameter
obdiag gather variable
obdiag gather all

folded

share

If OceanBase Diagnostic Tool (obdiag) is independently deployed, you can use obdiag gather commands to collect diagnostic information of OceanBase Database.

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.

Prerequisites

A zip tool is installed on the target nodes whose information is to be collected.

Syntax of gather commands

obdiag gather <gather type> [options]

Valid values of the gather type parameter are as follows:

  • log: collects logs of the specified OceanBase cluster.

  • sysstat: collects information about nodes in the specified OceanBase cluster.

  • clog: collects the clogs of the specified OceanBase cluster.

  • slog: collects the slogs of the specified OceanBase cluster.

  • plan_monitor: collects the execution details of parallel SQL statements with the specified trace ID in the specified OceanBase cluster.

  • stack: collects the stack information of the specified OceanBase cluster.

  • perf: collects the performance information of the specified OceanBase cluster.

  • obproxy_log: collects the logs of the OceanBase Database Proxy (ODP) on which the specified OceanBase cluster depends.

  • ash: collects the Active Session History (ASH) information of the specified OceanBase cluster.

  • all: collects the diagnostic information of the specified OceanBase cluster, including the logs, node information, stack information, and performance information of the cluster.

obdiag gather log

You can run this command to collect logs of the specified OceanBase cluster.

Note

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 gather log [options]

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of log collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of log collection in the yyyy-mm-dd hh:mm:ss format.
--since No string Empty The most recent period of time for log collection, in the format of <n> <m|h|d>, where n specifies the time value, m represents "minute", h represents "hour", and d represents "day". For example, 30m specifies to collect logs of the last 30 minutes.
--scope No string all The type of logs of the OceanBase cluster to be collected. Valid values: observer, election, rootservice, and all.
--grep No string Empty The search keyword.
--encrypt No string false Specifies whether to encrypt the returned files. Valid values: true and false.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.
--dis_update No bool false Specifies whether to enable automatic update. You can set the option to any value to disable automatic update.

Here is an example:

obdiag gather log --scope observer --from "2022-06-30 16:25:00" --to "2022-06-30 18:30:00" --grep STORAGE --encrypt true

...
ZipFileInfo:
+-------------------+-----------+
| Node              | LogSize   |
+===================+===========+
| xxx.xxx.xxx.xxx   | 36.184M   |
+-------------------+-----------+
...

ZipFileInfo:
+-------------------+-----------+
| Node              | LogSize   |
+===================+===========+
| xxx.xxx.xxx.xxx   | 44.176M   |
+-------------------+-----------+
...

Summary:
+-------------------+-----------+----------+------------------+--------+------------------------------------------------------------------------+
| Node              | Status    | Size     | Password         | Time   | PackPath                                                               |
+===================+===========+==========+==================+========+========================================================================+
| xxx.xxx.xxx.xxx   | Completed | 36.762M  | HYmVourcUyRNP8Om | 19 s   | gather_pack_20220701183246/result_xxx.xxx.xxx.xxx_20220701183247.zip   |
+-------------------+-----------+----------+------------------+--------+------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 638.200M | 1RicMaiLUUNfemnj | 718 s  | gather_pack_20220701183246/result_xxx.xxx.xxx.xxx_20220701183918.zip   |
+-------------------+-----------+----------+------------------+--------+------------------------------------------------------------------------+

Notice

If encryption is enabled, collected logs are encrypted when being compressed. The value in the Password column indicates the password for decrypting the .zip package. Encryption is disabled by default.

  • Here are examples of collecting logs of a recent period:

    # Collect logs of the last hour.
    obdiag gather log --since 1h
    
    
    # Collect logs of the last 30 minutes.
    obdiag gather log --since 30m
    
    # Collect logs of the last 30 minutes and specify the configuration file.
    obdiag gather log --since 30m -c /root/config.yml
    
  • Collect logs filtered by keyword.

    # Collect logs of the last 30 minutes that are filtered by "TRACE_ID".
    obdiag gather log --grep "TRACE_ID"
    
    # Collect logs of the last 30 minutes that are filtered by multiple keywords, such as "AAAAA" and "BBBBB".
    obdiag gather log --grep "AAAAA" --grep "BBBBB"
    
    # Collect logs of the specified period that are filtered by multiple keywords, such as "AAAAA" and "BBBBB".
    obdiag gather log --from "2022-06-30 16:25:00" --to "2022-06-30 18:30:00" --grep "AAAAA" --grep "BBBBB"
    

Notice

If logs are filtered by multiple keywords, the keywords are evaluated by using the "AND" operator. In other words, only logs that meet all the specified keywords are collected.

obdiag gather sysstat

You can run this command to collect information about hosts in the specified OceanBase cluster, such as the dmesg, CPU, and memory information of the hosts.

Note

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 gather sysstat [options]

The following table describes the options.

Option Required? Data type Default value Description
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

Here is an example: obdiag gather sysstat

The sample result is as follows:

Summary:
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                                |
+===================+===========+=========+========+=========================================================================+
| xxx.xxx.xxx.xxx   | Completed | 45.209K | 5 s    | gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip   |
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 42.170K | 5 s    | gather_pack_20220729164233/sysstat_xxx.xxx.xxx.xxx_20220729164233.zip   |
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+

obdiag gather clog

You can run the obdiag gather clog command to call the ob_admin tool on the target server to parse clog files and collect clogs within the specified time range.

Note

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 gather clog [options]

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of log collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of log collection in the yyyy-mm-dd hh:mm:ss format.
--since No string Empty The most recent period of time for log collection, in the format of <n> <m|h|d>, where n specifies the time value, m represents "minute", h represents "hour", and d represents "day". For example, 30m specifies to collect logs of the last 30 minutes.
--encrypt No string false Specifies whether to encrypt the returned files. Valid values: true and false.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

obdiag gather clog --from "2023-01-16 18:25:00" --to "2023-01-17 01:30:00"

Gather clog Summary:
+-------------------+-----------+---------+--------+-----------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                              |
+===================+===========+=========+========+=======================================================================+
| xxx.xxx.xxx.xxx   | Completed | 15.762K | 6 s    | gather_pack_20230118002457/obadmin_xxx.xxx.xxx.xxx_20230118002458.zip |
+-------------------+-----------+---------+--------+-----------------------------------------------------------------------+

obdiag gather slog

You can run the obdiag gather slog command to call the ob_admin tool on the target server to parse slog files and collect slogs within the specified time range.

Note

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 gather slog [options]

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of log collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of log collection in the yyyy-mm-dd hh:mm:ss format.
--since No string Empty The most recent period of time for log collection, in the format of <n> <m|h|d>, where n specifies the time value, m represents "minute", h represents "hour", and d represents "day". For example, 30m specifies to collect logs of the last 30 minutes.
--encrypt No string false Specifies whether to encrypt the returned files. Valid values: true and false.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

obdiag gather slog --from "2023-01-16 18:25:00" --to "2023-01-17 01:30:00"

Gather slog Summary:
+-------------------+-----------+---------+--------+-----------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                              |
+===================+===========+=========+========+=======================================================================+
| xxx.xxx.xxx.xxx   | Completed | 15.762K | 6 s    | gather_pack_20230118002457/obadmin_xxx.xxx.xxx.xxx_20230118002458.zip |
+-------------------+-----------+---------+--------+-----------------------------------------------------------------------+

obdiag gather plan_monitor

You can run this command to collect the execution details of parallel SQL statements with the specified trace ID in the specified OceanBase cluster. In this way, you can analyze the operators if the SQL statement execution is slow during analytical processing (AP).

Note

  • This command is supported only in OceanBase Database V3.0 and later.
  • Before you use this command, make sure that the connection information of the target cluster has been configured in the config.yml configuration file of obdiag. For more information, see Configure obdiag.
obdiag gather plan_monitor [options]

The following table describes the options.

Option Required? Data type Default value Description
--trace_id Yes string Empty In OceanBase Database of a version earlier than V4.0.0, you can query the gv$sql_audit view for trace IDs. In OceanBase Database V4.0.0 and later, you can query the gv$ob_sql_audit view for trace IDs.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.
--env No string Empty The connection string of the business tenant where the SQL statements corresponding to the specified trace ID belong. The connection string is mainly used to obtain the return result of the EXPLAIN statement.

Note

  • Before you use this command, make sure that the connection information of the target cluster has been configured in the config.yml configuration file of obdiag. For more information, see Configure obdiag.

Here is an example:

obdiag gather plan_monitor --trace_id YB420BA2D99B-0005EBBFC45D5A00-0-0 --env "{db_connect='-hxx -Pxx -uxx -pxx -Dxx'}"

Gather ob_admin Summary:
+-----------+--------+----------------------------------------------------------------------+
| Status    | Time   | PackPath                                                             |
+===========+========+======================================================================+
| Completed | 6 s    | gather_pack_20230118002457                                           |
+-----------+--------+----------------------------------------------------------------------+

obdiag gather stack

You can run this command to collect the stack information of the specified OceanBase cluster. This command is not supported for a cluster built in the ARM architecture.

Note

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 gather stack [options]

The following table describes the options.

Option Required? Data type Default value Description
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

Here is an example: obdiag gather stack

The sample result is as follows:

Summary:
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                                 |
+===================+===========+=========+========+==========================================================================+
| xxx.xxx.xxx.xxx   | Completed | 19.926K | 10 s   | gather_pack_20220729163951/obstack2_xxx.xxx.xxx.xxx_20220729163951.zip   |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 22.803K | 12 s   | gather_pack_20220729163951/obstack2_xxx.xxx.xxx.xxx_20220729163951.zip   |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+

obdiag gather perf

You can run this command to collect the performance information of the specified OceanBase cluster.

Note

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 gather perf  [options]

The following table describes the options.

Option Required? Data type Default value Description
--scope No string all The type of performance information to be collected. Valid values: sample, flame, and all.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

obdiag gather perf

Gather Perf Summary:
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| Node              | Status    | Size     | Time   | PackPath                                                             |
+===================+===========+==========+========+======================================================================+
| xxx.xxx.xxx.xxx   | Completed | 368.178K | 90 s   | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip   |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 368.178K | 90 s   | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip   |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+

obdiag gather obproxy_log

You can run this command to collect logs of the ODP on which the specified OceanBase cluster depends.

Note

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 gather obproxy_log [options]

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of log collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of log collection in the yyyy-mm-dd hh:mm:ss format.
--since No string Empty The most recent period of time for log collection, in the format of <n> <m|h|d>, where n specifies the time value, m represents "minute", h represents "hour", and d represents "day". For example, 30m specifies to collect logs of the last 30 minutes.
--scope No string all The type of ODP logs to be collected. Valid values: obproxy, obproxy_digest, obproxy_stat, obproxy_slow, obproxy_limit, and all.
--grep No string Empty The search keyword.
--encrypt No string false Specifies whether to encrypt the returned files. Valid values: true and false.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

obdiag gather obproxy_log --scope obproxy --from "2022-06-25 10:25:00" --to "2022-06-25 18:30:00" --encrypt true

...
ZipFileInfo:
+------------------+-----------+
| Node             | LogSize   |
+==================+===========+
| xxx.xxx.xxx.xxx  | 36.184M   |
+------------------+-----------+
...

ZipFileInfo:
+-------------------+-----------+
| Node              | LogSize   |
+===================+===========+
| xxx.xxx.xxx.xxx   | 44.176M   |
+-------------------+-----------+
...

Gather ObProxy Log Summary:
+-------------------+-----------+----------+------------------+--------+-----------------------------------------------------------------------------+
| Node              | Status    | Size     | Password         | Time   | PackPath                                                                    |
+===================+===========+==========+==================+========+=============================================================================+
| xxx.xxx.xxx.xxx   | Completed | 36.762M  | HYmVourcUyRNP8Om | 19 s   | gather_pack_20220701183246/obproxy_log_xxx.xxx.xxx.xxx_20220701183247.zip   |
+-------------------+-----------+----------+------------------+--------+-----------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 638.200M | 1RicMaiLUUNfemnj | 718 s  | gather_pack_20220701183246/obproxy_log_xxx.xxx.xxx.xxx_20220701183918.zip   |
+-------------------+-----------+----------+------------------+--------+-----------------------------------------------------------------------------+

obdiag gather ash

You can run this command to collect ASH reports.

Note

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 gather ash [options]

You can query the GV$ACTIVE_SESSION_HISTORY view for related ASH information.

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of sample collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of sample collection in the yyyy-mm-dd hh:mm:ss format.
--trace_id No string Empty The trace ID of the SQL statement to be sampled. If you do not specify this parameter or set the value to NULL, the trace ID is not limited.
--sql_id No string Empty The SQL ID of the SQL statement to be sampled. If you do not specify this parameter or set the value to NULL, the SQL ID is not limited.
--wait_class No string Empty The type of the wait event to be sampled. The valid values of WAIT_CLASS are the same as those of the GV$ACTIVE_SESSION_HISTORY.WAIT_CLASS field. If you do not specify this parameter or set the value to NULL, the type of wait events is not limited.
--report_type No string TEXT The type of the report. At present, only the TEXT type is supported. This parameter is optional.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:


obdiag gather ash

gather_ash_report start ...
gather from_time: 2024-05-13 10:59:41, to_time: 2024-05-13 11:29:41
from_time: 2024-05-13 10:59:41, to_time: 2024-05-13 11:29:41, sql_id: None, trace_id: None, report_type: TEXT, wait_class: None, store_dir: ./
save ash report file name: ./gather_pack_20240513112941/ash_report_20240513112941.txt

Gather ash_report results stored in this directory: ./gather_pack_20240513112941

Trace ID: 08acff2a-10d9-11ef-9b05-02420b9e4df1
If you want to view detailed obdiag logs, please run: obdiag display-trace 08acff2a-10d9-11ef-9b05-02420b9e4df1

obdiag gather tabledump

You can run this command to collect the information about a table, including the schema and data distribution information.

Note

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 gather tabledump [options]

The following table describes the options.

Option Required? Data type Default value Description
--database Yes string Empty The name of the database to which the table belongs.
--table Yes string Empty The name of the table.
--user Yes string Empty The username of a user in the tenant to which the table belongs.
--password Yes string Empty The password of the user in the tenant to which the table belongs.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:


obdiag gather tabledump --user=<MYUSER> --password=<MYPASSWORD> --database=<MYDATABASE> --table=<MYTABLENAME>

obdiag gather parameter

You can run this command to collect parameters of a cluster and store the information in a CSV file for parameter comparison and archiving.

Note

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 gather parameter [options]

The following table describes the options.

Option Required? Data type Default value Description
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:


obdiag gather parameter

obdiag gather variable

You can run this command to collect information about variables of a cluster and store the information in a CSV file for parameter comparison and archiving.

Note

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 gather variable [options]

The following table describes the options.

Option Required? Data type Default value Description
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:


obdiag gather variable

obdiag gather all

You can run this command to collect the diagnostic information of the specified OceanBase cluster, including the logs, host information, stack information, and performance information of the cluster.

Note

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 gather all [options]

The following table describes the options.

Option Required? Data type Default value Description
--from No string Empty The start time of log collection in the yyyy-mm-dd hh:mm:ss format.
--to No string Empty The end time of log collection in the yyyy-mm-dd hh:mm:ss format.
--since No string Empty The most recent period of time for log collection, in the format of <n> <m|h|d>, where n specifies the time value, m represents "minute", h represents "hour", and d represents "day". For example, 30m specifies to collect logs of the last 30 minutes.
--scope No string all The type of logs of the OceanBase cluster to be collected. Valid values: observer, election, rootservice, and all.
--grep No string Empty The search keyword.
--encrypt No string false Specifies whether to encrypt the returned files. Valid values: true and false.
--store_dir No string The current path where the command is executed The local path where the results are stored.
-c No string ~/.obdiag/config.yml The path of the configuration file.

Here is an example:

Collect the performance reports, logs, stack information, and performance information of the specified OceanBase cluster, as well as logs and CPU and memory information of hosts in the cluster.

obdiag gather all --from "2022-07-28 16:25:00" --to "2022-07-28 18:30:00" --encrypt true

...
ZipFileInfo:
+------------------+-----------+
| Node             | LogSize   |
+==================+===========+
| xxx.xxx.xxx.xxx  | 29.874M   |
+------------------+-----------+
...

ZipFileInfo:
+------------------+-----------+
| Node             | LogSize   |
+==================+===========+
| xxx.xxx.xxx.xxx  | 143.229M  |
+------------------+-----------+
...


...
# Logs of the specified period
Summary:
+-------------------+-----------+----------+------------------+--------+---------------------------------------------------------------------------------------+
| Node              | Status    | Size     | Password         | Time   | PackPath                                                                              |
+===================+===========+==========+==================+========+=======================================================================================+
| xxx.xxx.xxx.xxx   | Completed | 29.874M  | fB7FrrzTGl4EK5Hl | 20 s   | gather_pack_20220729170718/result_xxx.xxx.xxx.xxx_20220729222724_20220730003224.zip   |
+-------------------+-----------+----------+------------------+--------+---------------------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 143.229M | SGRbXvMyA7lrnFW1 | 74 s   | gather_pack_20220729170718/result_xxx.xxx.xxx.xxx_20220729222724_20220730003224.zip   |
+-------------------+-----------+----------+------------------+--------+---------------------------------------------------------------------------------------+

...


# Real-time information of the hosts where the observer process resides
Summary:
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                                |
+===================+===========+=========+========+=========================================================================+
| xxx.xxx.xxx.xxx   | Completed | 45.276K | 5 s    | gather_pack_20220729170856/os_info_xxx.xxx.xxx.xxx_20220729170856.zip   |
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 42.152K | 6 s    | gather_pack_20220729170856/os_info_xxx.xxx.xxx.xxx_20220729170856.zip   |
+-------------------+-----------+---------+--------+-------------------------------------------------------------------------+


# Stack information of the observer process
Summary:
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+
| Node              | Status    | Size    | Time   | PackPath                                                                 |
+===================+===========+=========+========+==========================================================================+
| xxx.xxx.xxx.xxx   | Completed | 22.693K | 13 s   | gather_pack_20220729170902/obstack2_xxx.xxx.xxx.xxx_20220729170902.zip   |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 19.902K | 13 s   | gather_pack_20220729170902/obstack2_xxx.xxx.xxx.xxx_20220729170902.zip   |
+-------------------+-----------+---------+--------+--------------------------------------------------------------------------+

Gather Perf Summary:
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| Node              | Status    | Size     | Time   | PackPath                                                             |
+===================+===========+==========+========+======================================================================+
| xxx.xxx.xxx.xxx   | Completed | 368.178K | 90 s   | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip   |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
| xxx.xxx.xxx.xxx   | Completed | 368.178K | 90 s   | gather_pack_20230117140836/perf_xxx.xxx.xxx.xxx_20230117140836.zip   |
+-------------------+-----------+----------+--------+----------------------------------------------------------------------+
# Collect logs of the last 2 hours.
obdiag gather all --since 2h

Previous topic

Inspection metrics
Last

Next topic

Use obdiag to collect information for specific scenarios
Next
What is on this page
Prerequisites
Syntax of gather commands
obdiag gather log
obdiag gather sysstat
obdiag gather clog
obdiag gather slog
obdiag gather plan_monitor
obdiag gather stack
obdiag gather perf
obdiag gather obproxy_log
obdiag gather ash
obdiag gather tabledump
obdiag gather parameter
obdiag gather variable
obdiag gather all