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

AI Intelligent Diagnosis Assistant

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

Function introduction
Preconfiguration
Configuration file structure description
Notes
Command description
Interaction example
FAQ

Since V4.0.0, obdiag supports starting the AI intelligent diagnostic assistant through the obdiag tool ai_assistant command. The assistant supports natural language interaction, can understand user intentions and invoke obdiag's collection, analysis, inspection, root cause analysis and other capabilities to perform diagnosis.

Attention

This feature is BETA version and requires configuration of LLM API (such as OpenAI or compatible interface). Optionally configure MCP for enhanced capabilities.

Function introduction

Capabilities
Description
Natural language interaction Use natural language to describe diagnostic requirements (such as "collect logs in the last hour", "check cluster health", "do a root cause analysis"), and the assistant will parse the intent and call the corresponding obdiag command.
Built-in MCP tool Obdiag's built-in MCP service is used by default, and capabilities such as gather/analyze/check/rca are exposed to LLM in the form of tools, and LLM decides when to call and what parameters to pass.
Optional external MCP External MCP services can be configured in ai.yml to extend more tools or data sources.

Preconfiguration

AI related items need to be configured before use, and the configuration file path is ~/.obdiag/ai.yml. Can be copied from conf/ai.yml.example and modified:

# For source install, copy from obdiag source tree: conf/ai.yml.example
cp /opt/oceanbase-diagnostic-tool/conf/ai.yml.example ~/.obdiag/ai.yml

Configuration file structure description

ai.yml is divided into three parts: llm (large model), mcp (MCP protocol), ui (interface and prompts).

LLM configuration (required)

Used to communicate with OpenAI or services compatible with OpenAI interfaces, api_key is required (environment variable OPENAI_API_KEY can also be used).

llm:
  api_type: openai                    # Type: openai or compatible API
  api_key: ""                         # API key; or set OPENAI_API_KEY
  base_url: ""                        # API base URL; or OPENAI_BASE_URL
  model: gpt-4                        # Model name, e.g. gpt-4, gpt-3.5-turbo, qwen-plus
  temperature: 0.7                    # Randomness 0–2; lower is more stable
  max_tokens: 2000                    # Max tokens per reply
  system_prompt: ""                   # Optional custom system prompt; empty uses built-in
```**base_url example**:

- OpenAI official: <https://api.openai.com/v1>
- Azure OpenAI: <https://your-resource.openai.azure.com/openai/deployments/your-deployment>
- Custom: <https://your-api-server.com/v1>

#### MCP configuration (optional)

The built-in MCP service is enabled by default, and tools such as obdiag's gather/analyze/check/rca can be used without additional configuration. Configuring `mcp.servers` is only required when using **external MCP services**.

```yaml
mcp:
  enabled: true                      # Enable MCP tools
  servers: ""                        # External MCP JSON; empty uses built-in only
  # For external MCP, JSON string compatible with mcp.json, e.g.:
  # servers: |
  #   {
  #     "my_server": {
  #       "command": "some-mcp-command",
  #       "args": ["stdio"]
  #     },
  #     "http_server": {
  #       "url": "http://127.0.0.1:8000/mcp"
  #     }
  #   }
```**Examples of built-in MCP tools**: gather_log, gather_sysstat, gather_perf, gather_obproxy_log, gather_ash, gather_awr, analyze_log, check, check_list, rca_run, rca_list, tool_io_performance, etc. Enter `tools` in interactive mode to view the list of currently loaded tools.

#### UI configuration (optional)

```yaml
ui:
  show_welcome: true                 # Show welcome banner on startup
  show_beta_warning: true            # Show BETA warning
  clear_screen: true                 # Clear screen before interactive session
  prompt: "obdiag AI> "              # Interactive prompt prefix

Notes

  • BETA function: The interface and behavior may be adjusted with the version. If you encounter any problems, please go to GitHub Issues for feedback.
  • API Fee: Calling external LLM will incur fees, please control the usage by yourself.
  • Sensitive information: obdiag will not send sensitive information such as cluster passwords to LLM; only the parameters required to execute the obdiag subcommand will be passed in as needed.
  • Network and Permissions: When executing gather/check/rca isochronous, it depends on the cluster configuration specified by -c and the SSH/network reachability of the current machine to the cluster, which is consistent with the requirements of directly executing the obdiag subcommand.

Command description

obdiag tool ai_assistant [options]
```| Option name | Is it required | Data type | Default value | Description |
|--------|----------|----------|--------|------|
| -c | No | string | `~/.obdiag/config.yml` | obdiag cluster configuration file path; the AI assistant will use this configuration to connect to the cluster when calling gather/check/rca, etc. |
| --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](801.crypto_config.md). |
| -h/--help | No | - | - | No need to pass a value. Configuration in the command means to view the command help. |
| -v/--verbose | No | - | - | There is no need to pass a value. The configuration in the command means that detailed logs will be output. |

### Commands in interactive mode

After startup, it enters interactive mode. In addition to natural language questions, it also supports the following commands:

| Command | Description |
|------|------|
| `help`/`?` | Display help and example questions. |
| `exit`/`quit`/`q` | Exit the AI assistant. |
| `clear` | Clear the conversation history of the current session (does not affect the executed obdiag command). |
| `history` | View the conversation history of the current session. |
| `tools` | Lists currently available diagnostic tools (built-in MCP and connected external MCP tools). |

## Usage example

### Start AI Assistant

```shell
obdiag tool ai_assistant

If using custom cluster configuration or encryption configuration, examples are as follows:

obdiag tool ai_assistant -c /path/to/config.yml
obdiag tool ai_assistant -c ~/.obdiag/config.yml.encrypted --config_password=your_secret

Interaction example

$ obdiag tool ai_assistant

╔══════════════════════════════════════════════════════════════════════════╗
║                    obdiag AI Assistant                                   ║
╠══════════════════════════════════════════════════════════════════════════╣
║  Welcome! I'm your AI assistant for OceanBase diagnostics.               ║
║  You can ask me to: Collect logs, Analyze data, Run health checks,       ║
║  Perform root cause analysis, and more.                                  ║
║  Type 'exit' or 'quit' to end. Type 'help' for more.                     ║
╚══════════════════════════════════════════════════════════════════════════╝

obdiag AI> Collect logs from the last hour
AI: Running log collection...
Command: obdiag gather log --since 1h
...

obdiag AI> Check cluster health
AI: Running cluster inspection...
Command: obdiag check run
...

obdiag AI> tools
🔌 Using built-in MCP server
📦 Loaded 12 tools: gather_log, gather_sysstat, gather_perf, ...

obdiag AI> exit
Goodbye!

FAQ

  • Error: OpenAI API key is required Please configure Key in llm.api_key in ~/.obdiag/ai.yml, or set the environment variable OPENAI_API_KEY.

  • **How ​​to use only built-in capabilities without connecting to the external network? ** Configure llm to serve an accessible OpenAI-compatible intranet or local model (base_url + api_key), and keep mcp.servers empty to use the built-in MCP tool.

  • **How ​​to check which tools were used in this session? ** Enter tools in the interaction to view the list of loaded tools and MCP connection status; if -v is turned on during execution, a more detailed call log will be output.

Previous topic

Configuration file encryption
Last

Next topic

Disk IO performance detection
Next
on this page
Function introduction
Preconfiguration
Configuration file structure description
Notes
Command description
Interaction example
FAQ