IBM Support

db2mon script for monitoring performance

Question & Answer


Question

The db2mon script is a created on top of the SQL monitoring interfaces provided by DB2 LUW It monitors database activity for a set amount of time ( default = 30 seconds ) and provides various metrics in a detailed report section as the output.

Cause

Performance troubleshooting is a challenging topic. This script is widely used within support to troubleshoot performance problems, it is generic in nature and works well with any flavour of DB2 ( including Purescale )

Instead of traditional snapshot monitoring, this uses the in-memory metrics interfaces available for obtaining various performance details about the database.

Answer

There is a master perl script which will generate the scripts needed : db2mon.pl db2mon.pldb2mon.pl

The usage is


$ ./db2mon.pl
Specify the DB2 version you would like to generate the script for.
db2mon.pl v1.0.1
Usage: ./db2mon.pl (9.7|10.1|10.5|11.1)(ORA)? [collect time in seconds; 0 means wait for <ENTER>]


This will generate scripts and sql files needed to run.
For your convenience, these have been provided here with the default 30 second runtime.

db2mon_v97.tardb2mon_v97.tardb2mon_v101.tardb2mon_v101.tardb2mon_v105.tardb2mon_v105.tardb2mon_v111.tardb2mon_v111.tar

A regular execution would be to just run :

./db2mon.sh <db> >> report.out

to interpret the data, look for "REPORT STARTS HERE" in the output file.

If the data needs to be retained for further analysis in a table format, then use the db2 -tvf db2mon_export.sql script instead. This produces ixf files that can be imported using the db2mon_import.sql file and a report can be generated using db2mon_report.sql

[{"Product":{"code":"SSEPGG","label":"DB2 for Linux- UNIX and Windows"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;10.1;10.5;11.1","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21993956