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

List of a lock concerned stmts

Hello,
When i execute "db2 select * from
TABLE(SYSPROC.SNAPSHOT_LOCK('Test',0)) as test_locks" , i get the
details of all the locks on db test
i want to know how to get the correspondence lock_stmts (the statements
that are concerned by each one of the locks)?

there is "db2 select * from TABLE(SYSPROC.SNAPSHOT_SQL_DYN('Test',0))
as test_qerys" but it only show the details of the stmts.

Thank you in advance

Laura

Dec 19 '06 #1
3 1678
Try joining it to snapshot_statment:

select
a.*,
b.stmt_text
from
table(snapshot_lock('mydb',-1)) a,
table(snapshot_statement('mydb',-1)) b
where
a.agent_id = b.agent_id;

/T
issam wrote:
Hello,
When i execute "db2 select * from
TABLE(SYSPROC.SNAPSHOT_LOCK('Test',0)) as test_locks" , i get the
details of all the locks on db test
i want to know how to get the correspondence lock_stmts (the statements
that are concerned by each one of the locks)?

there is "db2 select * from TABLE(SYSPROC.SNAPSHOT_SQL_DYN('Test',0))
as test_qerys" but it only show the details of the stmts.

Thank you in advance

Laura
Dec 19 '06 #2
Try joining it to snapshot_statment:

select
a.*,
b.stmt_text
from
table(snapshot_lock('mydb',-1)) a,
table(snapshot_statement('mydb',-1)) b
where
a.agent_id = b.agent_id;

/T
issam wrote:
Hello,
When i execute "db2 select * from
TABLE(SYSPROC.SNAPSHOT_LOCK('Test',0)) as test_locks" , i get the
details of all the locks on db test
i want to know how to get the correspondence lock_stmts (the statements
that are concerned by each one of the locks)?

there is "db2 select * from TABLE(SYSPROC.SNAPSHOT_SQL_DYN('Test',0))
as test_qerys" but it only show the details of the stmts.

Thank you in advance

Laura
Dec 19 '06 #3
Thanks for the response Tomas.

i'm sorry for the late response i was really really busy.

when i use the joining you said i always obtain a null statement_text
the locks ad the tables are right but the statements are null. I know
this can't be true as the SNAPSHOT_SQL_DYN is full of not null
statement_text.

there is the request i use:

select substr(char(b.agent_id),1,10) agent_id, substr(b.table_name,
1,30) table_name,case b.lock_object_type
when 1 then 'Table' when 2 then 'Row' when 3 then 'Internal'when 4
then 'Tablespace'
when 5 then 'EndOfTable' when 6 then 'KeyValue' else 'Internal'end as
type,
case b.lock_mode when 1 then 'IS' when 2 then 'IX'
when 3 then 'S' when 4 then 'SIX' when 5 then 'X' when 6 then 'IN'
when 7 then 'Z' when 8 then 'U' when 9 then 'NS' when 10 then 'NX'
when 11 then 'W' when 12 then 'NW'else 'Other'
end as mode ,substr(char(c.stmt_text),1,20) from
table(snapshot_lock('test',0)) b ,table(snapshot_statement('test',0))
c
where b.agent_id = c.agent_id

is there any problem in my statement ? if no is there any other way to
obtain list of locks without using snaphots?

Feb 6 '07 #4

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

Similar topics

16
by: flyaflya | last post by:
a = "(1,2,3)" I want convert a to tuple:(1,2,3),but tuple(a) return ('(', '1', ',', '2', ',', '3', ')') not (1,2,3)
7
by: xmp333 | last post by:
Hi, I know the noresize attribute will keep the user from resizing a frame, but is there a way to keep a frame from being resized by the browser (in response to things like different...
2
by: Trent | last post by:
Hello, all. I have the following production DB2 environment. DB2 8.1.4 (fp4) WG edition with 2 production databases on Windows 2003 standard edition. My first question is regard with...
8
by: Mark A | last post by:
The DB2 8.2 SQL Reference says SET CURRENT LOCK TIMEOUT is not under transaction control. I assume that means that changing it via the SQL command affects all connections to the database in the...
17
by: Rainer Queck | last post by:
Hi NG, one more question about thread safety of generic lists. Let's assume a generic list: List<MyTyp> aList = new List<MyType>(); Would it be a problem if one thread removes elements from...
1
by: Macca | last post by:
Hi, I am considering using a Generic List to hold user defined class entries. Since this List will be accessed by multiple threads I need it to be threadsafe. It appears there is no easy way to...
5
by: Jacob | last post by:
Hi there, Say I have an ArrayList named list. What's the difference between using lock(list) { .... } and lock(list.SyncRoot) { .... }
94
by: Samuel R. Neff | last post by:
When is it appropriate to use "volatile" keyword? The docs simply state: " The volatile modifier is usually used for a field that is accessed by multiple threads without using the lock...
16
by: castironpi | last post by:
Any ideas for a thread-safe list.removeall( X ): removing all occurrences of X within list L, when L might be modified concurrently? Sincerely, Aaron
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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 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.