Finding the SQL statement

Up to 4 KB of the SQL statement are included in the sections of the SVC dump that pertain to SQL problems. To find the SQL statement in the formatted section of the SVC dump, skim through the pages for the statement on the right. It is displayed in the space block, which contains the SPA eye-catcher.

About this task

There are occasions when Db2 might not load the current space block (SPA). In this case, RDASPPT1 points to the previously run SQL statement. This situation causes the RDASPPT1 to point to the previously run SQL statement.

Procedure

To locate the SQL statement in the unformatted section of the SVC dump:

  1. Locate the CTRDSP field at offset X'1C0' in the CT. This field contains the address of the RDA (relational data area).
  2. Locate the RDASPPT1 field at offset X'108' in the RDA. This field contains the address of the SPA (space block). The SPA begins with a header section, followed by several space block entries.
  3. Start of changeLocate the SPASQLTX field at offset X'88' in the header section of the SPA. This field is a pointer to the SQL statement within the first space block entry. End of change
  4. You can scan the right of the dump to locate the SQL statement. Otherwise, use the contents of SPASQLTX to pinpoint a 2-byte length field, which precedes the SQL statement.

Example

Figure 1. Finding the SQL statement
Begin figure description. This figure displays how to find the SQL statement. End figure description.