This morning was asked "How can I tell how long a lock has been held?"
I rifled through onstat -k, onstat -g ses (sesid) and onstat -u, but
didn't find anything that told me the "age" of the lock. Is there a
command that will do that?
DT
↪ replying to Dave Thacker
This will work:
select sl.grtime grant_time, st.dbsname, st.tabname, sl.rowidr, sl.keynum,
ft.txt[1,4], sr.sid, sr2.sid
from sysmaster:syslcktab as sl
join sysmaster:systabnames as st
on sl.partnum = st.partnum
join sysmaster:flags_text as ft
on sl.type = ft.flags and ft.tabname = 'syslcktab'
join sysmaster:systxptab as stt
on sl.owner = stt.address
join sysmaster:sysrstcb as sr
on stt.owner = sr.address
left outer join sysmaster:sysrstcb as sr2
on sl.wtlist = sr2.address
where sr.sid = <sessionid>
;
But it isn't fast.
Art S. Kagel
----- Original Message -----
From: Dave Thacker <ids@iiug.org>
At: 11/08 14:37:36
This morning was asked "How can I tell how long a lock has been held?"
I rifled through onstat -k, onstat -g ses (sesid) and onstat -u, but
didn't find anything that told me the "age" of the lock. Is there a
command that will do that?
DT
*******************************************************************************
Forum Note: Use "Reply" to post a response in the discussion forum.