db2

Terminate Lock chain applications

At my work, I used to get paged saying the reorg is on a lock wait, because some rouge application(s) are holding locks. This became annoying since it started to happen often, so I wrote a dirty little script that will loop through and force all the applications that causes reorg to go on lock wait.  However the script can be used for any application that goes on lock wait.  The script simply find a lock session thats on lock wait, then identify the culprit application and force that application handle and then checks for lock wait, if it find its releases that as well, it does it until all the locks are gone .  The script can be modified to suite your need. Like I said I planned to run the script only when the monitor picked up reorg getting on lock wait state.  Here is the script :  lockchain_killer.sh The script will only work on DB2 V9.1 and higher.