Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / November 2007

Tip: Looking for answers? Try searching our database.

How to find which SQL is causing the Lock

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rahul Babbar - 24 Nov 2007 06:25 GMT
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
Otto Carl Marte - 26 Nov 2007 19:19 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>
> 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!
Tomas - 26 Nov 2007 21:28 GMT
Rahul,

one possibility might be to join SNAPSHOT_LOCK to SNAPSHOT_STATEMENT.

/T

> Hi,
>
[quoted text clipped - 7 lines]
>
> Rahul
louisem - 27 Nov 2007 12:11 GMT
> Hi,
>
[quoted text clipped - 7 lines]
>
> Rahul

Hello,

I documented a new feature in V9.1 FP4 that you might find useful.
It's called the lock timeout reporting function. It will be available
in an upcoming V8 fix pack as well.

This is how we describe it:
"The lock timeout reporting function captures information about lock
timeout events, including information about the key applications
involved in the lock contention that resulted in the lock timeout.
This function is controlled by the DB2_CAPTURE_LOCKTIMEOUT registry
variable available in Fix Pack 4.

Information is captured for both the lock requestor (the application
that received the lock timeout error) and the current lock owner, and
the report is stored in a directory determined by a database
configuration parameter.

When a lock timeout occurs and the lock timeout reporting function is
active, the information is captured and placed in a lock timeout
report file."

You can check out details of the annoucement in our Information
Center:

http://publib.boulder.ibm.com/infocenter/db2luw/v9//topic/com.ibm.db2.udb.rn.doc
/doc/c0052972.htm


Louise McNicoll
DB2 Information Development
Otto Carl Marte - 27 Nov 2007 16:30 GMT
> > Hi,
>
[quoted text clipped - 37 lines]
> Louise McNicoll
> DB2 Information Development

Thats very cool :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.