DB2 event monitors

Sterling Selling and Fulfillment Foundation is written to minimize the occurrence of deadlocks. For example, critical database records such as inventory records are always obtained in the same order. However, deadlocks can still happen for many reasons including:

To help diagnose deadlocks, we recommend setting the following event monitor:

   MON=<monitor name - e.g., DLMON>
   OUTDIR=<directory to store deadlock information>
   
   db2 -v create event monitor $MON for deadlocks with details \
          write to file $OUTDIR buffersize 64 nonblocked
   db2 -v set event monitor $MON state = 1
   

When a deadlock occurs, issue the following:

   db2 flush event monitor $MON
   db2evmon -path $OUTDIR  
   

The flush ensures deadlock records in the buffers are written out. The db2evmon formats the deadlock information.