If OceanBase Diagnostic Tool (obdiag) is independently deployed, you can run this command to collect ASH reports.
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.
Syntax
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 event 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. |
| --inner_config | No | string | Empty | The configurations of obdiag. |
| --config | No | string | Empty | The configurations of the cluster diagnosed by obdiag, in the format of --config key1=value1 --config key2=value2.
NoteFor information about the parameters supported by this option, see Configure obdiag. |
Examples
Method 1: Use the command out-of-the-box without a configuration file
obdiag gather ash \
--config db_host=xx.xx.xx.xx \
--config db_port=xxxx \
--config tenant_sys.user=root@sys \
--config tenant_sys.password=***
The output is as follows:
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: ./obdiag_gather_pack_20240513112941/ash_report_20240513112941.txt
Gather ash_report results stored in this directory: ./obdiag_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
Method 2: Use the command with a configuration file
Before you run the 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
Results
The command generates an ASH report in the specified directory. A sample file path is ./obdiag_gather_pack_20240808105846/ash_report_20240513112941.txt.