Hitachi

Hitachi Advanced Database Command Reference


40.2.1 Explanation of the specification format and options

Organization of this subsection

(1) Specification format

adbstat
  [-c {sys|cnct|buf|sql}]
  [-n {application-identifier|global-buffer-name|connection-information}]
  [-m SQL-statement-statistical-information-output-date-and-time-specification]
  [-q SQL-statement-sequence-number]
  [-t]
  [-k enclosing-character]
  [-s {delimiter|tab}]

(2) Relationship between information that is output and options

The relationship between the information that is output by the adbstat command and the options is explained in the two tables below. For details about the information that is output, see 40.5 Items that are output.

■ Combination of options that are specified (part 1)

The table below explains the relationship between the information that is output and the options when the adbstat command is used to output the following information:

  • HADB server statistical information

  • Connection operation information

  • Global buffer statistical information

Table 40‒1: Relationship between information that is output by the adbstat command and the options (part 1)

No.

Information that is output

Option specifications

-c option

-n option

1

HADB server statistical information

sys or the option is omitted.

--#

2

Connection operation information for all valid connections

cnct

--

3

Connection operation information for a specific connection

cnct

application-identifier

4

Statistical information for all global buffers

buf

--

5

Statistical information for a specific global buffer

buf

global-buffer-name

Legend:

--: The -n option is omitted.

#

When sys is specified in the -c option or the -c option is omitted, specifying the -n option results in an error.

■ Combination of options that are specified (part 2)

The table below explains the relationship between the information that is output and the options when the adbstat command is used to output SQL statement statistical information.

Note

This subsection explains the recommended combinations of options for outputting SQL statement statistical information.

The amount of SQL statement statistical information can be large. By combining the options as shown in the following table to narrow down the output target, you can more easily find the information you need.

Table 40‒2: Relationship between information that is output by the adbstat command and options (part 2)

No.

Information that is output

Option specifications

-c option

-n option

-m option

-q option

1

In the SQL statement statistical information for a specific SQL statement, the information that was output to the statistics log file during a specified period

sql

connection-information

SQL-statement-statistical-information-output-date-and-time-specification

SQL-statement-sequence-number

2

In the SQL statement statistical information for an SQL statement that was executed with a specified connection, information that was output to the statistics log file during a specified period

sql

connection-information

SQL-statement-statistical-information-output-date-and-time-specification

--

3

SQL statement statistical information that was output to the statistics log file during a specified period

sql

--

SQL-statement-statistical-information-output-date-and-time-specification

--

4

SQL statement statistical information for a specified SQL statement

sql

connection-information

--

SQL-statement-sequence-number

5

SQL statement statistical information for an SQL statement executed with a specified connection

sql

connection-information

--

--

6

The most recent five minutes of SQL statement statistical information

The target range is five minutes in the past from the point when the last information was output to the statistics log file.

sql

--

--

--

Legend:

--: The option is omitted.

(3) Explanation of options

-c {sys|cnct|buf|sql}

Specifies the type of information to be output:

sys: HADB server statistical information

cnct: Connection operation information

buf: Global buffer statistical information

sql: SQL statement statistical information

-n {application-identifier|global-buffer-name|connection-information}

~<character string>

Specifies that the information for a specific connection or global buffer is to be output.

application-identifier:

Specifies the application identifier for which statistical information is to be output. You can specify this option when you specify cnct in the -c option.

global-buffer-name:

Specifies the name of the global buffer for which statistical information is to be output. You can specify this option when you specify buf in the -c option.

connection-information:

Specifies the connection for which information is to be output. You can specify this option when you specify sql in the -c option.

If you want to narrow down the SQL statement statistical information to be output, specify this option. This specification enables you to limit the output to the information for the specified connection information.

Note

If you want to narrow down the output target even further, specify connection information in this option, an output date and time specification in the -m option, and an SQL statement sequence number in the -q option.

If a non-existent application identifier, global buffer name, or connection information is specified in this option, no information will be output (only the title lines will be output). When the -t option is specified, neither information nor title lines will be output.

The following rules apply to specifying this information:

  • The character string specified as an application identifier or a global buffer name is treated as being in all uppercase letters.

  • If the application identifier or global buffer name includes a lowercase letter, enclose the entire application identifier or global buffer name in double quotation marks (") and then enclose it in single quotation marks ('). An application identifier or global buffer name enclosed in both double quotation marks and single quotation marks is treated as being case-sensitive.

    Example: -n '"ap001"'

  • The connection information is not case sensitive.

  • Specify one of the following for the connection information:

    • Connection information displayed in the KFAA81000-I message that was output to the message log file when the connection was established

    • Connection ID that was checked in the CID column in the adbls -d cnct command's execution results

    For details about the adbls -d cnct command, see 23. adbls -d cnct (Display the Connection Status).

-m SQL-statement-statistical-information-output-date-and-time-specification

Specifies a range of SQL statement statistical information to be output in terms of date and time information that was output to the statistics log file.

If no information within the specified range was output to the statistics log file, no information will be output (only the title lines will be output). When the -t option is specified, neither information nor title lines will be output.

Specify this option in the following format:

output-start-date-and-time[,output-end-date-and-time]

The following rules apply to specifying this information:

  • You can specify this option when you specify sql in the -c option.

  • Specify output-start-date-and-time and output-end-date-and-time in one of the following formats:

    yyyy/mm/ddΔhh:mm:ss

    yyyy-mm-ddΔhh:mm:ss

    Legend: Δ: Space

  • Because output-start-date-and-time and output-end-date-and-time each contains a space, you must use one of the following methods to specify this information:

    Example 1: If you specify only an output start date and time, enclose the entire output start date and time in single quotation marks (').

    -m '2014/06/06 12:00:00'

    Example 2: If you specify both an output start date and time and an output end date and time, enclose each of them in single quotation marks (').

    -m '2014/06/06 12:00:00','2014/06/06 13:00:00'

    Example 3: If you specify both an output start date and time and an output end date and time, enclose the entire date and time specification in single quotation marks (').

    -m '2014/06/06 12:00:00,2014/06/06 13:00:00'

  • Do not specify any spaces before or after the comma (,) that separates the output start date and time and the output end date and time.

  • An error will occur if a non-existent date and time is specified.

  • An error will occur if the specified output end date and time precedes the specified output start date and time.

  • If the output end date and time is omitted, all the statistical information in the statistics log file starting from the specified output start date and time is output.

  • The dates and times over which the statistical information to be output is output to the statistics log file is from the output start date and time to the output end date and time specified in this option. The command discards any fractions of a second in date and time information that was output to the statistics log file and then compares the resulting values with the specified output start date and time and output end date and time.

-q SQL-statement-sequence-number

~<integer>((1 to 18,446,744,073,709,551,615))

Specifies the sequence number of an SQL statement for which SQL statement statistical information is to be output.

If a non-existent SQL statement sequence number is specified in this option, no information will be output (only the title lines will be output). If the -t option is specified, neither information nor title lines will be output.

The following rules apply to specifying this information:

  • You can specify this option when you specify sql in the -c option.

  • Specify in this option an SQL-statement-sequence-number-since-connection-was-established from the KFAA51000-I messages that have been output to the message log file.

Important

To output the KFAA51000-I messages to the message log file, you must have specified in advance the adb_sql_text_out operand in the server definition so that SQL statements will be output to the message log file.

For details about the adb_sql_text_out operand in the server definition, see the topic Operands related to SQL statements (set format) in Detailed descriptions of the server definition operands in Designing the Server Definition in the HADB Setup and Operation Guide.

-t

Specifies that title lines (column headers) are not to be output.

-k enclosing-character

~<character string>((1 byte))<<">>

Specifies an enclosing character to be used for the character strings in CSV format. If this option is omitted, the double quotation mark (") is assumed to be the enclosing character.

A single-byte character must be specified as the enclosing character (a character string consisting of two or more bytes cannot be specified). None of the following characters are permitted to be the enclosing character:

  • Space, tab, asterisk (*)

  • The character that is used as the delimiter (the value of or default value for the -s option)

Important
  • If you specify a single quotation mark (') as the enclosing character, enclose it in double quotation marks (").

    Example: If you specify a single quotation mark (') as the enclosing character:

    adbstat ... -k "'" ...

  • If you specify as the enclosing character a special character used by the shell, such as the vertical bar (|), enclose it in either double quotation marks (") or single quotation marks (').

    Example: If you specify the vertical bar (|) as the enclosing character:

    adbstat ... -k "|" ...

  • Do not use as the enclosing character any character that is used in the column titles and contents output by the adbstat command. For details about the columns that are output by the adbstat command, see 40.5 Items that are output.

-s {delimiter|tab}

~<character string>((1 byte))<<,>>

Specifies the delimiter used in CSV format. To specify the tab character as the delimiter, specify tab. If this option is omitted, the comma (,) is assumed to be the delimiter.

Only tab or a single-byte character can be specified as the delimiter (except for tab, a character string consisting of two or more bytes cannot be specified). None of the following characters can be specified as the delimiter:

  • Uppercase letters (A to Z), lowercase letters (a to z), numeric characters (0 to 9), underscore (_), double quotation mark ("), asterisk (*)

  • The character that is used as the enclosing character (the value of or default value for the -k option)

Important
  • If you specify a single quotation mark (') as the delimiter, enclose it in double quotation marks (").

    Example: If you specify a single quotation mark (') as the delimiter:

    adbstat ... -s "'" ...

  • If you specify as the delimiter a special character used by the shell, such as the vertical bar (|), enclose it in either double quotation marks (") or single quotation marks (').

    Example: If you specify the vertical bar (|) as the delimiter:

    adbstat ... -s "|" ...

  • Do not use as the delimiter any character that is used in the column titles and contents output by the adbstat command. For details about the columns that are output by the adbstat command, see 40.5 Items that are output.