Capturing the query environment

Use the Capture Query Environment tool to capture diagnostic information for a query. This action is helpful if you need to work with the IBM® support team to resolve a problem with a query. The tool generates a .zip file that contains query environment reports that you can open in a browser.

  1. Open the editor on a program file that contains EXEC SQL statements.
  2. Select the contents of the EXEC SQL statement, and then right-click and select Db2 for z/OS > Tune Selected SQL.
    Tip: In the z Systems® LPEX Editor, use the Db2 menu on the product menu bar.
  3. On the Tuning Actions window, select Capture Query Environment, and then click OK.

    The tuning data is displayed in the Remote System Details view.

  4. To see the output of the action, select it and click Open Results. The tool generates a .zip file named with the job ID of the query for which the data was collected, for example, 1746152697765040128.zip. The Save Captured Query Environment window opens.
  5. Navigate to a location on your workstation to save the .zip.
  6. To see the captured reports, extract the contents of the .zip file.