Remark about lengths of SQL statement texts in SQL Activity traces
How extended SQL statement texts become visible in SQL Activity traces with IFCID 350.
An SQL Activity trace might show SQL statement texts in the report, depending on the subcommand options that were specified with the SQLACTIVITY TRACE command. The SQL statement texts are provided by IFCID 63, which limits the length to a maximum of 5000 characters. Consequently, SQL statement texts shown in SQL Activity trace reports are also limited to this length.
IFCID 350 records SQL statement texts up to a length of 2000000 characters each. However, IFCID 350 data is not shown in SQL Activity reports and traces; this is independent of whether IFCID 350 data is provided by a Db2 trace.
To obtain extended SQL statement texts, perform the following steps:
- Start a Db2 trace to collect data, using trace class 30, 31, or
32, and specifying IFCID 350, for example:
-START TRACE CLASS(30) IFCID(350) DEST(SMF) TDATA(CPU,COR,DIST)
- Create a Record Trace report (refer to Record Trace reports for details). Use the GLOBAL command and its options to minimize the amount of data that is produced by the Record trace and to filter the required data, similar to the following example:
GLOBAL FROM(,12:19:59.99) TO(,12:20:00.93) INCLUDE(IFCID(350))