Tuesday, February 21, 2012

Try MONREPORT to generate monitoring reports

DB2 includes several system-defined modules that can come in handy. One that I would like to point you to is MONREPORT. As the name may hint at it can be used to generate monitoring reports, i.e., to retrieve monitoring data and generate text reports out of the data. Basically, some useful reports with lots of health indicators and statistics are just a call away.

Did you try "call monreport.dbsummary()" yet? Most (all?) the statistics that you need in a single report without any sweat. The module also has procedures to retrieve information about current SQL activities, package cache statistics, lock waits, etc. What is interesting to note is that the monreport procedures utilize the new monitoring infrastructure introduced in DB2 9.7, the MON_GET functions. And if you search the DB2 system catalog, you can even find the sources to the procedures in the MONREPORT modules. Something to take a look at, learn from, and be inspired...