Capturing SQL statements by using records in the PLAN_TABLE table

Use the Capture SQL by Using Records in the PLAN_TABLE Table page to search the PLAN_TABLE table for a record that is related to SQL statements that you want to tune. After you retrieve a record, you can try to retrieve the related SQL statement from the SYSIBM.SYSPACKAGE table.

Before you begin

Procedure

To capture an SQL statement by using a record in the PLAN_TABLE table:

  1. In the Data Source Explorer, right-click the database on which the PLAN_TABLE table is located.
  2. Select Query Tuner > Start Tuning. The workflow assistant for query tuning opens to the Capture section.
  3. On the left side of the editor, select Plan Table under DB2 for z/OS Sources.
  4. Create a filter, or select an existing one, that sets criteria for how to find the SQL statement that you want.
  5. Click Run. The records that match the criteria of the filter appear in the Matching Records section.
  6. Right-click a record and select Retrieve Query.

What to do next

If the text of the SQL statement that corresponds to the record is in the SYSIBM.PACKAGE table, you can run advisors and tools on the statement. If the text of the corresponding SQL statement is not in that table, you can generate an access plan graph and run reports.


Feedback