10.11.1 About SQL tracing
SQL tracing is a function that outputs to files (SQL trace files) log information (SQL trace information) about execution of SQL statements. The information that is output to the SQL trace files includes the SQL statements that were executed, the SQL statement execution times, the access paths and so on.
The following figure provides an overview of SQL tracing.
- Explanation
-
SQL trace information is output to SQL trace files on the HADB server. You use a text editor to view SQL trace information that has been output to SQL trace files.
Only HADB administrators and the OS users that belong to the HADB administrators group can view SQL trace files.
The SQL trace information that has been output is used for the following purposes:
-
Determining the cause of SQL statement errors
Check the SQLCODE number that has been output as SQL trace information to determine from the message that corresponds to the SQLCODE number the cause of an SQL statement error.
-
Tuning SQL statements
Check the SQL statement execution times that are output as SQL trace information to identify SQL statements whose execution time took too long. Use SQL statement statistical information to tune SQL statements based on the connection information and SQL statement sequence numbers that are output as SQL trace information.
- ■ SQL trace information output destination
-
-
Name of output destination directory
$ADBDIR/spool
-
Names of SQL trace files
adbsqltrc01.log to adbsqltrc08.log
Eight SQL trace files are created. When one SQL trace file becomes full, the output destination is changed to the SQL trace file with the next sequence number. When adbsqltrc08.log becomes full, the output destination is changed back to adbsqltrc01.log.
-
- Note
-
The troubleshooting information that is acquired by the adbinfoget command includes the SQL trace files.