13 June,2012 by Tom Collins
Question: How can I trace and capture DB2 database deadlock details? I then want to view the deadlock details.
Answer: Capturing DB2 deadlock details is straightforward. Use a similar process to below. Basically, you create an Event Monitor , capture some activity into a file, drop the event monitor.
#connect to db #1-Create event monitor- make sure you've got write permissions db2 "CREATE EVENT MONITOR dlmon FOR DEADLOCKS WRITE TO FILE '/tmp'" #2 Turn on event monitordb2 SET EVENT MONITOR dlmon STATE = 1 #3. (Do stuff to the database that you want to monitor) #4. Turn off event monitordb2 SET EVENT MONITOR dlmon STATE = 0 #5. Translate event monitor into readable stuff db2evmon -path /tmp > /tmp/filtered.out #6. Read the events vi /tmp/filtered.out #7. db2 DROP EVENT MONITOR dlmon
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |