473,791 Members | 2,711 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.SNAPSHO T_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 6414
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.SNAPSHO T_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 (DB2DETAILDEADL OCK) that
"catches" deadlocks and records information regarding them:

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

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_STATEM ENT.

/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.SNAPSHO T_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
14820
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 certain is a hanging ASP script somewhere on the box. Probably an on error resume next line that doesn't go anywhere when an error is an encountered. Anyways, I'm not sure if there's a way to isolate the website where its originating, or even the...
0
3389
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 lock-wait, waiting to acquire row-level X locks. The lock-waits are behind applications that have row-level X locks on different rows (honestly). Both executing and lock-waiting applications have been granted IX table locks.
2
6235
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 applications, DB2Hmon will show as "compiling statement", If I issue a "connect to database"it will hang there until DB2HMON is completed and no longer showing as a active application. Below is a lock snapshot that occurs when this is happening....
1
1101
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 example if I type: MessageBox.Show( this, "Test", and then start using the Up and Down arrows to cycle through the overrides the IDE locks/freezes up everytime. To unfreeze the IDE you
2
4591
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 Here's the scenario: 1. .NET Windows Client on a remote machine makes a web service call to update tables on a Web Server running SQL Server 2000. 2. The Update is updating about 1000 - 3000 records doing simple update statements like "Update...
23
2582
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 record's fields turning into chinese characters. On running the compact/repair I can see that the corruption may be deeper than I expected because sometimes indexes are missing and need to be replaced. I used to think that overuse of 'ctrl-alt-delete'...
4
1907
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 = (SELECT orig_subm_id FROM submission WHERE subm_id = ?) Optimizer Plan:
0
1194
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 giving page not found exception when i try to retrieve the data to display form the same table. When i do the same operation on B from my applciation it is not throwing any error. 1)Is it to do with the lock levels set on the data base. can you...
8
2198
by: Raxit | last post by:
Hi, In Mulithreaded program, using Posix api, we do pthread_mutex_lock(&Lock)
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10154
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9993
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5430
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
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.