DB2 Monitor for long running queries

Jim Youmans
Jim Youmans used Ask the Experts™
What is the best way to monitor for queries that run > xx seconds?  I would love to have a table / file that I can look at each morning to see if there are any issues.  I've read about event monitors but I did not see a way to restrict them to a certain time range and we have so many queries that run, I am afraid to capture ever SQL statement that runs.  I think that would blow out my storage pretty quickly.

What is the most common way to do this with DB2?

Thank you!

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi Jim,

db2audit can do most of this.  Check out the examples on this IBM page:


If any of the examples look like they'll do what you want, then we can figure out how to set it up.

Jim YoumansSr Database Administrator


Thank you!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial