Hitachi

Hitachi Advanced Database Setup and Operation Guide


10.11.6 Operation when SQL trace information is set to be output

This subsection explains the operations when SQL trace information is set to be output.

(1) Making a backup of SQL trace files explains the operations that need to be performed regularly when SQL trace information is set to be output. The subsections starting with (2) Checking the SQL trace information that has been output explain the operations that are to be performed only as needed.

Organization of this subsection

(1) Making a backup of SQL trace files

When one SQL trace file becomes full as a result of output of SQL trace information, another SQL trace file is used. There are a total of eight SQL trace files. Once all SQL trace files become full, output of SQL trace information continues by overwriting the oldest file. Therefore, if you want to save the collected SQL trace information, back up the SQL trace files.

When output to one SQL trace file is switched to another SQL trace file, the KFAA81004-I message is output to the message log file. When this message is output, back up the SQL trace file that is being swapped out.

(2) Checking the SQL trace information that has been output

If you want to check what kind of information has been output as the SQL trace information, execute the adbchgsqltrc command.

■ Command execution example

adbchgsqltrc -d
 
sqltrace param    accesspath level
ACTIVE   ACTIVE   INACTIVE   SQL
Explanation
  • sqltrace

    Displays whether SQL trace information has been output. In this example, ACTIVE is displayed (SQL trace information has been output).

  • param

    Displays whether dynamic parameter information has been output. In this example, ACTIVE is displayed (dynamic parameter information has been output).

  • accesspath

    Displays whether access path information and access path statistical information have been output. In this example, INACTIVE is displayed (access path information and access path statistical information have not been output).

  • level

    Displays the unit of SQL trace information output. In this example, SQL is displayed (SQL trace information was output by SQL statement).

For details about the execution results of the adbchgsqltrc command, see adbchgsqltrc (Start or Stop Output of SQL Trace Information) in the manual HADB Command Reference.

(3) Changing the SQL trace information to be output

If you want to change the SQL trace information to be output, execute the adbchgsqltrc command.

■ Command execution example

Example 1: Stopping output of dynamic parameter information

adbchgsqltrc -n param
Explanation
  • -n param

    Specifies that output of dynamic parameter information is to be stopped.

Example 2: Starting output of access path information and access path statistical information by call

adbchgsqltrc -y accesspath -l call
Explanation
  • -y accesspath

    Specifies that output of access path information and access path statistical information is to be started.

  • -l call

    Specifies that the output is to be by call.

For details about the options that can be specified when the adbchgsqltrc command is executed, see adbchgsqltrc (Start or Stop Output of SQL Trace Information) in the manual HADB Command Reference.

Note that changes made with the adbchgsqltrc command to the SQL trace information to be output do not take effect the next time the HADB server starts. The next time the HADB server starts, the information specified in the server definition is applied.

(4) Stopping output of SQL trace information

If you want to stop output of SQL trace information, execute the adbchgsqltrc command.

■ Command execution example

adbchgsqltrc -e

For details about the options that can be specified when the adbchgsqltrc command is executed, see adbchgsqltrc (Start or Stop Output of SQL Trace Information) in the manual HADB Command Reference.

Note that the setting to stop output of SQL trace information that is specified with the adbchgsqltrc command does not take effect the next time the HADB server starts. The next time the HADB server starts, the information specified in the server definition is applied.

(5) Starting output of SQL trace information

If you want to start output of SQL trace information, execute the adbchgsqltrc command.

■ Command execution example

adbchgsqltrc -s

For details about the options that can be specified when the adbchgsqltrc command is executed, see adbchgsqltrc (Start or Stop Output of SQL Trace Information) in the manual HADB Command Reference.

Note that the setting to start output of SQL trace information that is specified with the adbchgsqltrc command does not take effect the next time the HADB server starts. The next time the HADB server starts, the information specified in the server definition is applied.

(6) Checking the output destination files for the SQL trace information

You use the update dates and times of the SQL trace files to determine the SQL trace file to which SQL trace information has been output. The current SQL trace information is being output to the SQL trace file with the most recent update date and time. You can use the OS's ls command, for example, to check the update dates and times of the SQL trace files.

If the update date and time of an SQL trace file has been changed because you updated the SQL trace file by, for example, using a text editor, the current output destination cannot be determined from the update dates and times of the SQL trace files. Check the end date and time of the last SQL statement output to each SQL trace file. The SQL trace file containing the SQL statement with the most recent date and time is the current output destination.