If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > SQL statements holding a lock ...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-14-08, 19:26
Kota Kota is offline
Registered User
 
Join Date: Jun 2003
Posts: 113
SQL statements holding a lock ...

I tried looking at the snapshot and associate an agent_id holding a lock to a dynamic SQL without luck. I was able to associate static SQLs though. Does someone have a query which I can run against table defined functions to get this info. or is there a way to get the information from the regular 'get snapshot'.

This is the best I could come up with

db2 "select a.agent_id,c.appl_name,c.appl_status,a.LOCKS_HELD, a.LOCK_WAITS,a.row
s_written,a.lock_timeouts,b.stmt_text,d.agent_id,d .table_name from table(snapshot_appl('',-1)) as a,table(snapshot_statement('',-1)) b,table(snapshot_appl_info('',-1)) as c,table(snapshot_lockwait('',-1)) as d where a.agent_id=b.agent_id and c.agent_id=a.agent_id and a.lock_waits!=0 and a.agent_id=d.agent_id_holding_lk"

Thanks
kota
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On