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

Blocking Agent ID for Locks in SNAPSHOT_*

Hi,

I am trying to find a way to query for the (lock) blocking connection
on my DB2 server. I am using DB2 for LUW 8.1 and 8.2. I have two
connections, one which has an exclusive lock, and the other which is
being blocked by the connection with the exclusive lock. I want to be
able to query for the locks on the system, the agent id of each
connection and which connection is blocking which. The problem I am
having is finding the blocking connection. I am using the
SNAPSHOT_LOCK and SNAPSHOT_LOCKWAIT table functions. The problem I am
having is that the SNAPSHOT_LOCKWAIT table function is not returning
any values, but that is where the blocking ID column is defined.

Does anyone know how to find the blocking Agent ID of a connection?

Below are the results from a query on SNAPSHOT_LOCK and
SNAPSHOT_LOCKWAIT.

thanks
-Niels
select *
FROM TABLE(SNAPSHOT_LOCK('SAMPLE', 0)) AS S
-------------------------------------------

SNAPSHOT_TIMESTAMP AGENT_ID TABLE_FILE_ID LOCK_OBJECT_TYPE
LOCK_MODE LOCK_STATUS LOCK_OBJECT_NAME PARTITION_NUMBER
LOCK_ESCALATION TABLE_NAME TABLE_SCHEMA TABLESPACE_NAME

--------------------- ----------- ----------------
------------------- ------------ -------------- -------------------
------------------- ------------------ ------------- ---------------
------------------
11/15/2004 4:03:30 PM 261 18 2
3 1 4099 (null)
0 SYSROUTINES SYSIBM SYSCATSPACE

11/15/2004 4:03:30 PM 261 18 2
3 1 4104 (null)
0 SYSROUTINES SYSIBM SYSCATSPACE

11/15/2004 4:03:30 PM 261 18 1
1 1 18 (null)
0 SYSROUTINES SYSIBM SYSCATSPACE

11/15/2004 4:03:30 PM 261 0 9
3 1 0 (null)
0 (null) (null) (null)

11/15/2004 4:03:30 PM 261 0 8
3 1 0 (null)
0 (null) (null) (null)

11/15/2004 4:03:30 PM 260 17 1
2 1 17 (null)
0 CUSTOMER DB2ADMIN USERSPACE1

11/15/2004 4:03:30 PM 260 0 9
3 1 0 (null)
0 (null) (null) (null)

11/15/2004 4:03:30 PM 260 0 8
3 1 0 (null)
0 (null) (null) (null)

11/15/2004 4:03:30 PM 259 17 2
5 1 4 (null)
0 CUSTOMER DB2ADMIN USERSPACE1

11/15/2004 4:03:30 PM 259 17 1
2 1 17 (null)
0 CUSTOMER DB2ADMIN USERSPACE1

11/15/2004 4:03:30 PM 259 0 8
3 1 0 (null)
0 (null) (null) (null)
11 record(s) selected [Fetch MetaData: 0/ms] [Fetch Data: 0/ms]

select *
FROM TABLE(SNAPSHOT_LOCKWAIT('SAMPLE', 0)) AS s
--------------------------------------------------------

SNAPSHOT_TIMESTAMP AGENT_ID SUBSECTION_NUMBER LOCK_MODE
LOCK_OBJECT_TYPE AGENT_ID_HOLDING_LK LOCK_WAIT_START_TIME
LOCK_MODE_REQUESTED PARTITION_NUMBER LOCK_ESCALLATION
TABLE_NAME TABLE_SCHEMA TABLESPACE_NAME APPL_ID_HOLDING_LK

--------------------- ----------- -------------------- ------------
------------------- ---------------------- -----------------------
---------------------- ------------------- -------------------
------------- --------------- ------------------
---------------------

0 record(s) selected [Fetch MetaData: 0/ms] [Fetch Data: 0/ms]

Apr 6 '06 #1
0 1368

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

Similar topics

5
by: Nils Pommerien | last post by:
Hello Newsgroup, I have written a very short program to get information from a whole table out of a database. the problem is that other people couldn't work on this table during the process. It...
1
by: neo | last post by:
Hi, we're having a problem with SQL 2000 and Opta 2000 JDBC driver where there is large update running and at the same time, read is blocked for a while. We're looking for a way to catch this...
6
by: Lauren Quantrell | last post by:
Is it possible the existence of a return parameter on an SP running insert statements would cause blocking to happen (any removing it might help eliminate it?) The SPs in question have three...
1
by: Hal | last post by:
SQL2K, sp3 Active Server Pages front-end I am having a blocking problem with a spid executing a stored procedure that does no updates. When I look at the locks the blocking spid has, some of...
4
by: A. Tillman | last post by:
We are having a really big problem with a zombie process/transaction that is blocking other processes. When looking at Lock/ProcessID under Current Activity I see a bunch of processes that are...
4
by: Richard | last post by:
hi, I am using SQL SERVER 2000. Problem that i am facing is when ever I check locks in Enterprise Manager I find following blocking - : 1) sp_cursoropen;1 2) sp_cursorclose;1 3)...
1
by: mz1313 | last post by:
MOM contains its own Block Analysis script. It is a script written on VB, that looks for the monitored servers, creates for each one MomCreateObject("SQLDMO.SQLServer"), afterwards connects to each...
0
by: yaron | last post by:
Hi, I need a code sample for doing this: - support for multiple agents that know each other and can talk each other over a non-blocking TCP socket. each agent can send and recieve data...
4
by: Michel Esber | last post by:
Environment: DB2 v8 LUW FP 15 running on Linux. For some reason that I can´t explain, a simple insert statement on a table may run very quickly, or may take forever (20-30mins) to finish....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.