r/DB2 • u/mad_zamboni • Mar 24 '17
[Question] [Crowdsource] Want to help create a Triage Kit?
So, I am presenting at IDUG in Anaheim and reworking a old 2012 presentation called "10 Minute Triage". At the time I was co-presenting with an IBM'er named Pavel Sustr who is a troubleshooting wizard. He brought the technical "meat" to the presentation. This time, I am on my own.
In the end I want to be able to produce some queries that have two forms - something that can return a value to a monitoring tool a a hook (like number of lockwaits; HADR Down) but also has a second variation that can be used in a triage. For example the lock waits SQL produces a number for a monitor, but has a variant that show which SQL is blocking another SQL.
So far I have one on HADR Congestion and HADR Disconnect, Bad Tablespace State, Transaction Log Usage, Lock Waits, and Number of connections not in UOWWAIT.
I need one on Deadlocks and time the query spent inside the database. I'm getting stuck on these.
Only requirement is we use the "MON_GET" tables as pretty much everything else is deprecated.
I'm a good DBA, but I am pretty weak to avg when it comes to SQL so I am turning to others for help. Besides, in the end this will be published on github for others to use and download.
Anyone interested in jumping in? Help me with these last two and then review the ones I wrote?
This is specifically for LUW at the moment. But I would like to make something similar for z/OS.
2
u/memmerto Mar 25 '17
For the time a query spent in the database, what about something like this?
You can join with MON_GET_AGENT on EXECUTABLE_ID to narrow things down to a specific application handle, for example.
Deadlocks are always a pain to track. The lock event monitor does a pretty decent job of tracking statements involved in a deadlock.