473,395 Members | 1,629 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,395 software developers and data experts.

how to get db2 lock waits details

Hi all,
with db2 snapshot I know the lock waits number but I can not see the
tables with locks an I can not see queries that produces locks.

How can I know those details?


Marco Strullato
Aug 19 '08 #1
3 30746
Marco wrote:
Hi all,
with db2 snapshot I know the lock waits number but I can not see the
tables with locks an I can not see queries that produces locks.

How can I know those details?
You have to look at a lock snapshot, not a database snapshot. You
can do this with:

get snapshot for locks on <dbname>

Or, as someone else suggested, using the SNAPSHOT_LOCK table function.
Aug 19 '08 #2
Marco wrote:
Hi all,
with db2 snapshot I know the lock waits number but I can not see the
tables with locks an I can not see queries that produces locks.

How can I know those details?
Try this:
Aug 22 '08 #3

tells which application id is locking,

db2 get snapshot for locks on $db_name | grep -i 'agent holding
tells which application ids are locked,

db2 list applications $db_string show detail .whos.out00
sed -n '1,4p' .whos.out00
sed -n '5,$p' .whos.out00 | grep -i 'lock.*wait'

once you get the locked app-id's, simple " db2 get snapshot for
application agentid <app-id" will show something like,

ID of agent holding lock = 1058
Application ID holding lock =
Lock name =
Lock attributes = 0x00000000
Release flags = 0x00000001
Lock object type = Table
Lock mode = Exclusive Lock (X)
Lock mode requested = Intention Share Lock (IS)
Name of tablespace holding lock = TBSP_4K_DATA1
Schema of table holding lock = SL
Name of table holding lock = ADJUSTREASONXREF
Lock wait start timestamp = 03/16/2007

Beware locking agent could itslef be locked by someone else. Best
thing is to jott down locking ID ('s) and locked ID ('s)
under 2 column, and draw arrow --pointing to whose locking whom.
Then its easy to see what's going on.

Also db2pd gives a little of info. But navigating db2pd canbe

Aug 24 '08 #4

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

Similar topics

by: Bruce Pullen | last post by:
DB2 v7.2 (FP7 - DB2 v7.1.0.68) on AIX We're seeing unexpected single row (then commit) insert locking behaviour. We're seeing Applications that already hold row-level W locks in...
by: news_account | last post by:
what commands can I use to find out what connection is causing a lock? where can i change the verbosity level of db2 logfiles? where are those logfiles? Greetings & Thanks Victor
by: ibm_97 | last post by:
update anywhere V8.2 on AIX I got a warning message for our Apply server side: asncap average lock wait time is 10.2 asncap lock waits: 1 asncap locks_hold: 12 The current value for...
by: Raj | last post by:
I created a refresh deferred MQT, and during full refresh there were 4 or 5 lock waits, all waiting on a 'S' lock on Internal Catalog Cache ? Can some one explain how to prevent this from happening?
by: situ | last post by:
Hi, we i get a snapshot for lock on db i'm getting LOCK_LIST_IN_USE =5560 and my LOCKLIST parameter = 50, is it ok for OLTP database or do i have to do any tuning here. thanks sridhar
by: rattas | last post by:
Hi all I'm using DB2 V9.1.0 on SUSE Linux with kernel version 2.6.5. In the system I'm working on, there are 2 stored procedures which perform simple selects through different views. Those...
by: PaulR | last post by:
Hi all, (DB2 LUW 8.2) I'm just trying to write a little widget to capture lock wait details (when they occur). i.e when a lock-wait occurs, simply record the 2 statements involved in the...
by: shorti | last post by:
Hello all, I am running with DB2 UDB V8 on AIX. I am trying to track down what appears to be a lock issue. I turned EVENT MONITOR on with all the options. It doesnt give me the detailed...
by: michael.spoden | last post by:
Hi, how can I fix lock-waits during an online backup? Is an online backup in DB2 V8.2 not realy online? I'm using DB2 V8.2 Fixpak 15 on Linux. The command to perform the backup is: db2 backup...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
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: 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...
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...

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.