obdiag commands

2023-12-04 01:56:26  Updated

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.

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
-c/--components No String oceanbase-ce The name of the component used to access OceanBase Database.
--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.
-u/--user No String root The name of the user who can log on to the OceanBase cluster.
-p/--password No String Empty The password of the user who can log on to the OceanBase cluster.
--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, pstack, 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.

Contact Us