473,503 Members | 1,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to find which SQL is causing the Lock

Hi,

Is there any way to find the SQL that is causing the Locks.

I am using SYSPROC.SNAPSHOT_LOCK to find out the locks on the table,
but i am unable to find out which SQL statement was responsible for
the lock.

Thanks a lot

Rahul
Nov 24 '07 #1
2 6395
On Nov 24, 1:25 am, Rahul Babbar <rahul.babb...@gmail.comwrote:
Hi,

Is there any way to find the SQL that is causing the Locks.

I am using SYSPROC.SNAPSHOT_LOCK to find out the locks on the table,
but i am unable to find out which SQL statement was responsible for
the lock.

Thanks a lot

Rahul
When you say Locks, i assume you mean database deadlocks. The db2pd
utility (DB2 9) is an excellent utility to view the locks that have
been acquired at a particular instant in time.

DB2 also by default has an event monitor (DB2DETAILDEADLOCK) that
"catches" deadlocks and records information regarding them:

The output is in a directory like:
<instance owner home>/NODE0000/SQL00001/db2event/db2detaildeadlock

And you can mine this information with the db2evmon utility:
db2evmon -path . /tmp/deadlockoutput.txt

Finding database deadlocks is a nasty business. So good luck!

Nov 26 '07 #2
Rahul,

one possibility might be to join SNAPSHOT_LOCK to SNAPSHOT_STATEMENT.

/T

On Nov 23, 10:25 pm, Rahul Babbar <rahul.babb...@gmail.comwrote:
Hi,

Is there any way to find the SQL that is causing the Locks.

I am using SYSPROC.SNAPSHOT_LOCK to find out the locks on the table,
but i am unable to find out which SQL statement was responsible for
the lock.

Thanks a lot

Rahul
Nov 26 '07 #3

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

Similar topics

11
14767
by: Rollin 4 Eva | last post by:
I've got a Windows 2000 server running with about 50 websites on it, all running ASP scripts. I've noticed that the servers CPU usage gets up 100% sometimes, caused by dllhost.exe, which I'm...
0
3368
by: Bruce Pullen | last post by:
DB2 v7.2 (FP7 - DB2 v7.1.0.68) on AIX 5.2.0.0. We're seeing unexpected single row (then commit) insert locking behaviour. We're seeing Applications that already hold row-level W locks in...
2
6182
by: Mike | last post by:
Hellos again, I seem to be having a weird issue. Whenever DB2 Health monitor seems to run, all connections to the database seem to just lock up. For example: (and this seems consistent) In list...
1
1085
by: Andrew Baker | last post by:
Since installing SP1 and using VS.NET 2003 I have been having terrible problems with the intellisense locking the IDE. It only seems to happen with certain assemblies, but happens a lot. For...
2
4560
by: Chris Langston | last post by:
I have a Web Server running IIS 5 or 6 on Windows 2K and Windows 2003 Server that is experiencing strange shutdown problems. We are using ASP.NET v1.1 and our application is written in VB.NET ...
23
2530
by: Dave G | last post by:
Since upgrading one of my clients from A97/W2000 to A2003/XP they have suffered no end of data corruption problems, mainly involving one of the main tables. The corruption can result in one...
4
1885
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
1177
by: ramyareddy | last post by:
Hi All, i am using mssql 2005 and i am facing a strange problem. i have two databases A , B.When i try to insert one row in A from my application it is inserting the row but after that it is...
8
2185
by: Raxit | last post by:
Hi, In Mulithreaded program, using Posix api, we do pthread_mutex_lock(&Lock)
0
7192
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
7315
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7445
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5559
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4991
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4665
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
721
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.