Question : Tracking DB2 database transactions delays

We have a large application that accesses a DB2 database
That application processes "batch" files that arrives in a special directory
Upon "receiving" of a file, the application (JBoss, Java) processes it by accessing the DB for many many queries, updates and inserts
Several files, and this is often the case, can be processes simultaneously.
However when this is the case, it seems that there are some long locking period  in the database as the completion of the work is longer and longer
We wonder if there is a DB2 tool (monitoring) that we can activate, and that will trace all requests sent to the RDBMS, but also indicating how long it took for each of these to complete

Answer : Tracking DB2 database transactions delays

If this is DB2 UDB (Linux, Windows or Unix), you can have your DBA setup a Statement Event Monitor.  This will capture all SQL and give the amount of time each took.  However, this will not report LOCK-WAIT time which you are concerned with - and it will spew out tons of information and could easily consume all of your free disk space.

In order to determine what is causing the database contention, the best "free" tools available are the LIST APPLICATION SHOW DETAIL command to see which connections are in a LOCK-WAIT state and/or the GET SNAPSHOT FOR ALL APPLICATIONS which will show what each connection is doing and if they are in lock-wait, what are they waiting for and from who.  Both of these commands will have to be run at regular intervals to generate the type of information needed to diagnose the problem.  Start running  every minute and run more often if necessary.

Both solutions will require that you turn on the MONITOR SWITCHES - I recommend turning on all of them to get the most information possible to diagnose this problem.

There are tools available - such as the ACTIVITY MONITOR which is part of the DB2 V9 client  - that can help diagnose the issue.  Other monitoring tools such as the Optim Performance Manager and Quest Spotlight which can be bought to help diagnose these types of problems.

Personally, I have a set of homegrown scripts that use the List Application and Get Snapshot infotrmation to monitor and diagnose these types of problems 24x7.  They are not pretty (no GUI, just test) but they get the job done quickly and for free.

Greg
Random Solutions  
 
programming4us programming4us