Viewing SQL activity for a selected summary
When you view activity summaries in Db2® Query Monitor, you can view the SQL activity for the activity level of interest, such as a specific plan, Db2 subsystem, or program.
Procedure
- On the IBM DB2 Query Monitor for z/OS panel (the main menu), specify option 1, and press Enter.
- On the Select Summary Level panel, specify the level at which you want to summarize activity information, and press Enter.
-
On the Operational Summaries panel or the Structural Summaries panel, specify the S line command next to the activity level of interest for which you want to view SQL activity.
The Activity by SQL Text panel is displayed:
Figure 1. Activity by SQL Text panel YYYY/MM/DD HH:MM:SS ---- Activity by SQL Text ---- Row 1 of 6 Option ===> Scroll ===> PAGE QM Subsystem : QM01 Interval Start Date: MM/DD/YYYY Time: HH:MM:SS Filters Enabled : N Interval End Date: CURRENT Time: CURRENT Hide STMTID data: N NAVI: Plan:PLAN0123 CMD - Enter "/" to select action --------------------------------------------------------------------------- > CMD SQL Text Exec Count Calls -- ---------------------------------------- -------------- -------------- __ SELECT MIN(E.SALARY) FROM GLWTEMP E, GLW 12 12 __ SELECT MIN(E.SALARY) FROM GLWTEMP E, GLW 1 5 __ SELECT MAX(EMPTIME) FROM GLWTEPA 17 17 __ SELECT MAX(EMPTIME) FROM GLWTEPA 1 5 __ SELECT MAX(E.SALARY), MAX(D.EMPLOYEE_CNT 29 29 __ SELECT MAX(E.SALARY), MAX(D.EMPLOYEE_CNT 1 5 ***************************** Bottom of Data **********************************
Scroll left to view more columns. For rows that display dynamic SQL, the Db2, Plan, Program, and Section number columns are blank.
To control whether the STMTID, QUERYNO, and DCLSTMT columns are displayed, use the HIDECOL STMTID and SHOWCOL STMTID commands. SHOWCOL STMTID displays these columns, and HIDECOL STMTID removes these columns from the display. Because these commands initialize a new view for the different column sets, different settings might be applied to these views (such as column order, sorting, and fixed columns). Based on these settings, the cursor might be repositioned when switching between the views.
- Optional:
To view the complete SQL text for a specific row, use the V or VF line command.
Tip: On the resulting Display SQL Statement Text panel, you can use the VIEW command to open an ISPF VIEW session where you can edit and save the SQL text. See Viewing SQL text.