Re: Monitoring lock tables
Posted in 2000
Leonid Vorontsov wrote:
> There is syslocktab table in sysmaster database, but unfortunately this
> table is undocumented.
> Explain columns in this table, please. And write an SQL statement for
> monitoring all locks
> with session, table, lock type if You can.
Well, all right, since you asked so sweetly...
lk_id: index into lock table
lk_addr: addr of lock structure
lk_same: list of same locks
lk_wtlist: list of waiters (rstcb *)
lk_owner: owner of lock (rtx *)
lk_list: list of owner's locks
lk_type: type of lock
lk_flags: lock flags
lk_bsize: size of bytes key
lk_keynum: keynum of item lock
lk_rowid: real rowid if key lock
lk_partnum: partnum lock is on
lk_kvobj: key value locked
lk_dipnum: pagenum if deleted item
lk_grtime: time lock was granted
select username, sid, dbsname, tabname, l.lk_type lock_type, l.lk_kvobj
rowid, lk_keynum key_num
from sysrstcb r, syslocktab l, systabnames t
where r.txp = l.lk_owner
and t.partnum = l.lk_partnum
I didn't bother figuring out what the numeric lock_type means, but surely
that should be easy. I personally prefer to see hex rowids; if you do too,
you can use hex(l.lk_kvobj) in the select list.
Gotta run.
June
--
june_t@hotmail.com
Lost in the wilds of Palo Alto, living on Oreo's