Previously wrote a query run to see the longest running app. The query is to the application. Like my program. IIS was found, and it was useless.
Select elapsed_time_min,appl_status,agent_id from Sysibmadm.long_running_sql ORDER BY elapsed_time_min DESC FETCH First 5 Rows only
Query the longest running SQL to use the snapshot.
First, run the following statement to turn on the off-first switch:
DB2 UPDATE MONITOR Switches USING lock on
DB2 UPDATE MONITOR switches USING sort on
DB2 UPDATE MONITOR switches USING Bufferpool on
DB2 UPDATE MONITOR switches USING table on
DB2 UPDATE MONITOR Switches USING statement on
DB2 UPDATE MONITOR switches USING UOW on
And then run
DB2 GET SNAPSHOT for DYNAMIC SQL on Easdb >>d:\dynamicsql.txt
Search in output file: Total elapsed time (in seconds. milliseconds)
For example, I use notepad++, search results, and then find the appropriate SQL to see if I can change the code, or change the SQL
DB2 optimizing the underlying query for the longest running SQL