OceanBase Deployer (obd) is integrated with OceanBase Diagnostic Tool (obdiag). You can run obdiag commands in obd to scan and collect diagnostic information such as OceanBase Database logs, SQL audit information, and OceanBase Database process stack information. For more information about obdiag, visit obdiag repository on GitHub.
obd obdiag deploy
You can run this command to install and deploy obdiag on your local host.
obd obdiag deploy
obd obdiag gather
You can run this command to call obdiag to collect the diagnostic information of OceanBase Database.
obd obdiag gather <gather type> <deploy name> [options]
where, the gather type parameter can be set to the following:
log: collects logs of the specified OceanBase cluster.sysstat: collects the host information of the specified OceanBase cluster.clog: collects the commit logs (clogs) of the specified OceanBase cluster.slog: collects the storage logs (slogs) of the specified OceanBase cluster.plan_monitor: collects the execution details of parallel SQL statements of 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 logs of the OceanBase Database Proxy (ODP) on which the specified OceanBase cluster depends.all: collects all of the above.scene: collect the diagnostic information of an OceanBase cluster in the specified failure scenario.
obd obdiag gather log
You can run this command to collect logs of the specified OceanBase cluster.
obd obdiag gather log <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
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. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | Empty | The last period of time for log collection in the format of <n> <m|h|d>. n specifies the time value. m represents "minute". h represents "hour". d represents "day". Example: 30m, which 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 | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather sysstat
You can run this command to collect the host information of the specified OceanBase cluster, such as the dmesg, CPU, and memory information of the host.
obd obdiag gather sysstat <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --store_dir | No | String | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather clog
You can run this command to collect clogs of the specified OceanBase cluster.
obd obdiag gather clog <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --from | No | String | Empty | The start time of clog collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of clog collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | Empty | The last period of time for clog collection in the format of <n> <m|h|d>. n specifies the time value. m represents "minute". h represents "hour". d represents "day". Example: 30m, which specifies to collect clogs 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 | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather slog
You can run this command to collect slogs of the specified OceanBase cluster.
obd obdiag gather slog <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --from | No | String | Empty | The start time of slog collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of slog collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | Empty | The last period of time for slog collection in the format of <n> <m|h|d>. n specifies the time value. m represents "minute". h represents "hour". d represents "day". Example: 30m, which specifies to collect slogs 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 | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather plan_monitor
You can run this command to collect the execution details of parallel SQL statements of the specified trace ID in the OceanBase cluster. This allows you to 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.
obd obdiag gather plan_monitor <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --trace_id | Yes | String | Empty | You can view the trace IDs in the gv$sql_audit view in OceanBase Database earlier than V4.0.0, or in the gv$ob_sql_audit view in OceanBase Database V4.0.0 or later. |
| --env | No | String | Empty | Additional configuration information. Here, the value is the connection string for connecting to the OceanBase database to obtain the execution plan, for example, --env "{db_connect='-hxx -Pxx -uxx -pxx -Dxx'}". |
| --store_dir | No | String | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather stack
You can run this command to collect the stack information of the specified OceanBase cluster. This command does not support an ARM-based architecture.
obd obdiag gather stack <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --store_dir | No | String | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather perf
You can run this command to collect the perf information of the specified OceanBase cluster.
obd obdiag gather perf <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --scope | No | String | all | The source from which the perf information is collected. Valid values: sample, flame, and all. |
| --store_dir | No | String | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather obproxy_log
You can run this command to collect logs of the ODP on which the specified OceanBase cluster depends.
obd obdiag gather obproxy_log <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
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. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | Empty | The last period of time for log collection in the format of <n> <m|h|d>. n specifies the time value. m represents "minute". h represents "hour". d represents "day". Example: 30m, which specifies to collect logs of the last 30 minutes. |
| --scope | No | String | all | The type of logs of the ODP cluster 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 | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather all
You can run this command to collect all diagnostic information of the specified OceanBase cluster, such as the logs and the host, stack, clog, slog, and perf information of the OceanBase cluster.
obd obdiag gather all <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
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. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | Empty | The last period of time for log collection in the format of <n> <m|h|d>. n specifies the time value. m represents "minute". h represents "hour". d represents "day". Example: 30m, which 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 | Current path in which the command is executed | The local path that stores the result. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag gather scene run
You can use this command to collect the diagnostic information of an OceanBase cluster in the specified failure scenario.
obd obdiag gather scene run <deploy name> --scene=<SceneName> [options]
The deploy name parameter specifies the name of the deployed cluster, which is also the alias of the configuration file. The SceneName parameter specifies the name of the failure scenario. You can run the obd obdiag gather scene list command to view supported scenarios.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --scene | Yes | String | Empty | The name of the failure scenario. You can run the obd obdiag gather scene list command to view the scenarios supported by the current version. |
| --from | No | String | Empty | The start time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The value must be enclosed with double quotation marks ("), for example, "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The value must be enclosed with double quotation marks ("), for example, "1970-01-01 13:00:00". |
| --since | No | String | Empty | The most recent period of time for which logs are collected, in the \<n> <m\|h\|d> format, where n is a number, m indicates minutes, h indicates hours, and d indicates days. For example, 30m specifies to collect logs of the last 30 minutes. |
| --env | No | String | Empty | Additional configuration information of the scenario. You can run the obd obdiag gather scene list command to view the scenarios and configuration information. |
| --store_dir | No | String | The current path where the command is executed | The local path where the results are stored. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
| --dis_update | No | String | true | Specifies to disable the automatic update of collection scenario configurations. It is a reserved parameter. |
obd obdiag check
Checks the state of an OceanBase cluster. Currently, obd analyzes the OceanBase cluster by using system kernel parameters and internal tables. It identifies the existing or potential causes of cluster issues and provides O&M suggestions.
obd obdiag check <deploy name> [options]
The deploy name parameter specifies the name of the deployed cluster and can be considered as an alias for the configuration file.
The following table describes the related options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --cases | No | String | All tasks will be executed by default. | A collection of check items to be executed. If this option is not specified, all tasks will be executed. For more information about tasks, see Use obdiag to inspect an OceanBase cluster in the obdiag documentation. |
| --store_dir | No | String | ./check_report/ | The output path for the check report. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
| --dis_update | No | String | true | Specifies to disable the automatic update of collection scenario configurations. It is a reserved parameter. |
obd obdiag analyze
You can run this command to call obdiag to analyze and diagnose the specified OceanBase cluster managed by obd.
obd obdiag analyze <analyze type> <deploy name> [options]
Valid values of the analyze type parameter are described as follows:
log: specifies to analyze logs of the specified OceanBase cluster managed by obd.
flt_trace: specifies to analyze trace logs of the specified OceanBase cluster managed by obd for end-to-end diagnostics.
obd obdiag analyze log
You can run this command to analyze logs of the specified OceanBase cluster managed by obd.
obd obdiag analyze log <deploy name> [options]
The deploy name parameter specifies the name of the deployed cluster and can be considered as an alias for the configuration file.
The following table describes the related 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. The double quotation marks (") are required. Example: "1970-01-01 12:00:00". |
| --to | No | String | Empty | The end time of log collection in the "yyyy-mm-dd hh:mm:ss" format. The double quotation marks (") are required. Example: "1970-01-01 13:00:00". |
| --since | No | String | This option is left empty by default. | A recent period of time for log collection in the format \<n> <m\|h\|d>, where n is a number, m represents minutes, h represents hours, and d represents days. For example, 30m specifies to collect logs from the last 30 minutes. |
| --scope | No | String | all | The type of OceanBase cluster logs to analyze. Valid values are described as follows:
|
| --grep | No | String | This option is left empty by default. | The keyword to search for. |
| --log_level | No | String | WARN | The minimum level of OceanBase Database logs to analyze. The available log levels in ascending order are DEBUG, TRACE, INFO, WDIAG, WARN, EDIAG, ERROR. |
| --files | No | String | This option is left empty by default. | The offline analysis mode for log files. The relevant OceanBase Database logs or log paths are needed. In offline analysis mode, the --from, --to, and --since options are not needed. |
| --store_dir | No | String | Current execution path | The local path to store the results. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag analyze flt_trace
You can run this command to analyze trace logs of the specified OceanBase cluster managed by obd for end-to-end diagnostics.
obd obdiag analyze flt_trace <deploy name> [options]
The deploy name parameter indicates the name of the deployed cluster, which is also the alias of the configuration file.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --flt_trace_id | Yes | String | The value of the flt_trace_id parameter |
You can obtain the value by querying the FLT_TRACE_ID field in the GV$OB_ SQL _AUDIT view or searching the trace.log file for the value. For more information about the GV$OB_ SQL _AUDIT view, see GV$OB_ SQL _AUDIT in the OceanBase Database documentation. |
| --store_dir | No | String | The default path is the current path in which the command is executed. | The local path where the results are stored. |
| --files | No | String | This parameter is left empty by default. | The OceanBase Database log file or path to the log file to be analyzed in offline analysis mode. If you specify the --files parameter, the offline analysis mode is enabled. |
| --top | No | String | 5 | The number of leaf nodes that take the longest time in the end-to-end diagnostics. |
| --recursion | No | String | 8 | The maximum number of layers for recursive end-to-end diagnostics. |
| --output | No | String | 60 | The number of displayed rows of the result. The full result is stored in the result file. |
| -c | No | String | ~/.obdiag/config.yml |
Specifies the configuration file path. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |
obd obdiag rca run
You can use this command to analyze the diagnostic information of an OceanBase database managed by OceanBase Deployer (obd) in a specified failure scenario to find the possible cause of the issue.
obd obdiag rca run <deploy name> --scene=<scene_name> [options]
The deploy name parameter specifies the name of the deployed cluster, which is also the alias of the configuration file. The scene_name parameter specifies the name of the failure scenario. You can run the obd obdiag rca list command to view supported scenarios.
The following table describes the options.
| Option | Required | Data type | Default value | Description |
|---|---|---|---|---|
| --scene | Yes | String | Empty | The failure scenario for root cause analysis. You can run the obd obdiag rca list command to view the list of supported scenarios. |
| --store_dir | No | String | ./rca |
The path where the root cause analysis results are stored. |
| --parameters | No | String | Empty | It is a reserved option and requires no attention for now. |
| --obdiag_dir | No | String | $HOME/oceanbase-diagnostic-tool | The installation directory of obdiag. |