This article applies to the scenario of independent deployment of obdiag. Use the obdiag gather ash command to collect ASH reports with one click.
If it is a cluster deployed by obd, you can directly collect information on the selected cluster through the obd side diagnostic command group.
Instructions for use
obdiag gather ash [options]
To obtain ASH related information, you need to query the GV$ACTIVE_SESSION_HISTORY view.
The options are explained below:
Option name |
Is it required |
Data type |
Default value |
Description |
|---|---|---|---|---|
| --from | No | string | Default is empty | The starting time of sampling collection, the format is: yyyy-mm-dd hh:mm:ss.
ExplanationIf 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 sampling collection, the format is: yyyy-mm-dd hh:mm:ss.
ExplanationIf 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. |
| --trace_id | No | string | Default is empty | TRACE_ID of the SQL to be sampled. If left blank or NULL, TRACE_ID is not restricted. |
| --sql_id | No | string | Default is empty | SQL_ID of the SQL to be sampled. Leave it blank or NULL to indicate that the SQL_ID is not restricted. |
| --wait_class | No | string | Default is empty | The type of event to be sampled. For the value of WAIT_CLASS, refer to the value of the GV$ACTIVE_SESSION_HISTORY.WAIT_CLASS field. Leave it blank or NULL to indicate that the wait type is not restricted. |
| --svr_ip | No | string | Default is empty | Filter sampling data by OBServer node IP.
DescriptionThis option only supports OceanBase database V4.3.5.0 and above. |
| --svr_port | No | int | Default is empty | Filter sampling data by OBServer node port.
DescriptionThis option only supports OceanBase database V4.3.5.0 and above. |
| --tenant_id | No | int | Default is empty | Filter sampled data by tenant ID.
DescriptionThis option only supports OceanBase database V4.3.5.0 and above. |
| --report_type | No | string | TEXT | Report type, supports TEXT and HTML types. The HTML type needs to be supported by OceanBase database V4.2.4.0 and above. |
| --store_dir | No | string | Defaults to the current path where the command is executed | The local path where the results are stored. |
| -c | No | string | ~/.obdiag/config.yml |
Configuration file path. |
| --inner_config | No | string | Default is empty | obdiag's own configuration. |
| --config | No | string | Default is empty | Configuration of the cluster to be diagnosed by obdiag, fixed style: --config key1=value1 --config key2=value2.
ExplanationThe 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.
ExplanationFor details, see Configuration file encryption. |
Usage example
Method 1: Use without configuration file (out of the box)
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 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 ash
Interpretation of results
After the command is executed, an ASH report will be generated in the specified directory. The file format is: ./obdiag_gather_pack_20240808105846/ash_report_20240513112941.txt
