473,387 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to find out the SQL statements causing deadlock?

Hello,

We are runnig DB2 on AIX and have DB2 deadlock problem.
Is there any way or any tool to find out which SQL statements cause the deadlock?

Thanks a lot.
Nov 12 '05 #1
3 26433
Not mentioned in this article is the fact that in V8.1 we now create a detailed deadlock event monitor for you so if you are using DB2 UDB V8.1 and are seeing deadlocks you should simply be able to format the event monitor output to see the deadlock events AND the SQL statements involved in the deadlock situation. The deadlock event monitor is called DB2DETAILDEADLOCK.

Also not mentioned in the article is the fact that to ensure that you get the full deadlock event monitor output to your file, turn off the event monitor (set its state to 0) before using db2evmon to dump the records, otherwise you will not get all the records in the file. Then simply turn the state back to zero. You can also try the FLUSH EVENT MONITOR SQL in this case, but I tend to do the former.

In any event, that will give you the SQL you are interested in...

--

Bob
Consulting I/T Specialist
IBM Toronto Lab
IBM Software Services for Data Management
[My comments are solely my own and are not meant to represent an official IBM position - ask my cat!]
"Haider Rizvi" <ha****@nouce.ca.ibm.com> wrote in message news:ad**********@ca.ibm.com...
Read up
http://www7b.software.ibm.com/dmdd/l...10wilkins.html
Regards,
--
Haider
Nov 12 '05 #3
Correction - I see the FLUSH EVENT MONITOR SQL statement is in this article ... sorry I did not see it earlier ...

--

Bob

Not mentioned in this article is the fact that in V8.1 we now create a detailed deadlock event monitor for you so if you are using DB2 UDB V8.1 and are seeing deadlocks you should simply be able to format the event monitor output to see the deadlock events AND the SQL statements involved in the deadlock situation. The deadlock event monitor is called DB2DETAILDEADLOCK.

Also not mentioned in the article is the fact that to ensure that you get the full deadlock event monitor output to your file, turn off the event monitor (set its state to 0) before using db2evmon to dump the records, otherwise you will not get all the records in the file. Then simply turn the state back to zero. You can also try the FLUSH EVENT MONITOR SQL in this case, but I tend to do the former.

In any event, that will give you the SQL you are interested in...

--

Bob
Consulting I/T Specialist
IBM Toronto Lab
IBM Software Services for Data Management
[My comments are solely my own and are not meant to represent an official IBM position - ask my cat!]
"Haider Rizvi" <ha****@nouce.ca.ibm.com> wrote in message news:ad**********@ca.ibm.com...
Read up
http://www7b.software.ibm.com/dmdd/l...10wilkins.html
Regards,
--
Haider
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Robert Brown | last post by:
I have a deadlock that's happening on one oracle instance but cannot be reproduced on any other. It is always caused by the same SQL statement colliding with itself and only happens under very high...
1
by: dawatson833 | last post by:
I want to set an alert for a specific table whenever an event has caused a deadlock to occur on the table. I understand how to set up an alert. But I don't know which error number to use for...
7
by: Andrew Mayo | last post by:
Here's a really weird one for any SQL Server gurus out there... We have observed (SQL Server 2000) scenarios where a stored procedure which (a) begins a transaction (b) inserts some rows into...
3
by: Nigel Robbins | last post by:
Hi There, I'm getting a deadlock when I have two clients running the following statement. DELETE FROM intermediate.file_os_details WHERE file_uid = ? AND obj_uid There is a compound index on...
6
by: Todd McNeill | last post by:
Hi- We ran into some very strange deadlocks this AM, and I was hoping to get some insight. We were running a REORGCHK on a database, and started getting deadlocks. What is curious is that...
13
by: Jonathan Amsterdam | last post by:
I think there's a slight design flaw in the Queue class that makes it hard to avoid nested monitor deadlock. The problem is that the mutex used by the Queue is not easy to change. You can then...
4
by: pike | last post by:
8.1 FP11 on AIX 5.3. The following DELETE is poorly performing and causing lock escalation (and subsequent deadlock time-outs): DELETE FROM submission_log WHERE subm_id = ? OR subm_id =...
0
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to...
0
by: Mezhnik | last post by:
Could anyone help me understand the deadlock graph posted below? and, maybe, the reason behind the deadlock? Any help is very appreciated. Thank you. 2008-03-31 04:32:06.40 spid4s Deadlock...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.