473,796 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_LOCKWA IT table functions. The problem I am
having is that the SNAPSHOT_LOCKWA IT 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_LOCKWA IT.

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

SNAPSHOT_TIMEST AMP AGENT_ID TABLE_FILE_ID LOCK_OBJECT_TYP E
LOCK_MODE LOCK_STATUS LOCK_OBJECT_NAM E PARTITION_NUMBE R
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('SAMPL E', 0)) AS s
--------------------------------------------------------

SNAPSHOT_TIMEST AMP AGENT_ID SUBSECTION_NUMB ER LOCK_MODE
LOCK_OBJECT_TYP E AGENT_ID_HOLDIN G_LK LOCK_WAIT_START _TIME
LOCK_MODE_REQUE STED PARTITION_NUMBE R LOCK_ESCALLATIO N
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 1407

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

Similar topics

5
8575
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 seems that my program locks the whole table. I used the DataReader from the .NET Framework. Can you please take a look at the code and give me any solution??? Thank very much, Nils Dim strSQL As String = "SELECT * FROM TESTTABLE"
1
5148
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 blocking process and if it last more than 10 minutes, then email or send out a message. I know sp_lock returns all current locks but how do you know which one is blocking other processes? Thanks for your help in advance.
6
2606
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 INSERT INTO statements using an @@IDENTITY to help populate the second and third tables based on the PK of the newly inserted record in the first INSERT INTO Statement. I have recently stared to receive timeout errors in a multi-user enviroment and...
1
1512
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 them have lock mode "IS". Looking in BOL, I see "S" is shared, but I don't see "IS". Can anyone tell me what lock mode "IS" is? And how could a stored procedure that does no updates be guilty of
4
7737
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 blocked by process 94 and process 94 is blocked by process -2. I assume -2 is a zombie that has an open transaction. I cannot find this process to kill and it seems that this transaction is surviving database restarts. I know which table is...
4
7807
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) sp_cursorfetch;1
1
2686
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 database on each server and executes SELECT GETDATE() query. If MOM doesn't receive answer for 6 minutes, it sends alert. Several times since I started to monitor my servers I received the next alert: The program "SQLDMO_789" has been blocked...
0
1127
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 to/from each other. - handling agent down events (i don't know how to do it in an elegant way when using the socket select method).
4
1723
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. There is a trigger (AFTER INSERT for each row) on this table. I have studied the execution plan, and it seems normal to me. The total query cost is below 2000. There are no huge tablescans as well.
0
9680
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9528
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,...
1
10174
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
10012
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
9052
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...
1
7548
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5442
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...
2
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.