Informix: syslcktab.owner and sysrstcb.address
Posted in 2026
Topics: High Availability & Replication
I'm trying to recall the connections between onstat -u and onstat -g ses at the SMI level.
I know that in the output of onstat -u, the 3rd column is the session ID (SID) and I can get from there to other stuff a user is doing. However, I need to do this at the SMI level. My aged Swiss-cheese memory is that syslvktab.owner is a link to sysrstcb.address. If that is correct (a big "if" ) then I can trace from a table/partition (systpnhdr.partnum) to a lock (syslcktab.partnum) to an rstcb (sysrstcb.partnum) to a session (sysrstcb.sid). I have further plans for this but this is a basic starting point: The SMI equivalent of onstat -u.
Is sysrstcb the starting point I'm looking for? A pretty good bet that Lester K has covered this in one of his presentations but I can't search them all right now.
Thanks for guidance.
------------------------------
+-----------------------------------------------------------+
| I am pleased to report that I had no problems today. |
| I had only issues, opportunities, challenges and valuable |
| learning experiences. |
+------------------------------------------ Jacob S --------+
------------------------------
Not tested ..... at all ... in anyway ....
DATABASE sysmaster;
SELECT HEX(r.address) AS address,
r.flags AS rawflags,
CASE WHEN s.is_wlock = 1 THEN 'L'
WHEN s.is_wbuff = 1 THEN 'B'
WHEN s.is_wckpt = 1 THEN 'C'
WHEN s.is_wlogbuf = 1 THEN 'G'
WHEN s.is_wlatch = 1 THEN 'S'
WHEN s.is_wtrans = 1 THEN 'T'
ELSE '-' END AS wait_type,
s.is_incrit AS in_critical,
s.is_monitor AS monitor,
r.sid AS sessid,
r.username AS user,
s.tty,
r.timeout AS tout,
r.nlocks AS locks,
r.nreads,
r.nwrites
FROM sysrstcb r, OUTER syssessions s
WHERE r.sid = s.sid
AND r.address <> 0
ORDER BY r.sid;
the wait column
SELECT w.sid, w.username AS waiter,
l.owner AS holder_sid, l.dbsname, l.tabname, l.type
FROM syslocks l, syssessions w
WHERE l.waiter = w.sid;
On 10/22/2026 6:10 PM, Jacob Salomon via IBM Community wrote:
I'm trying to recall the connections between onstat -u and onstat -g ses at the SMI level. I know that in the output of onstat -u, the 3rd... -posted to the "Informix" group
tested on V14/15 SELECT LOWER(TRIM(LEADING '0' FROM SUBSTR(HEX(r.address), 3))) AS address, (CASE WHEN BITAND(r.flags, 4) <> 0 THEN 'L' -- lock WHEN BITAND(r.flags, 8) <> 0 THEN 'B' -- buffer WHEN BITAND(r.flags, 16) <> 0 THEN 'C' -- checkpoint WHEN BITAND(r.flags, 4096) <> 0 THEN 'G' -- logical log buffer WHEN BITAND(r.flags, 262144) <> 0 THEN 'T' -- transaction WHEN BITAND(r.flags, 2) <> 0 THEN 'S' -- mutex WHEN th.th_conwait <> 0 THEN 'Y' -- condition ELSE '-' END || '-' || (CASE WHEN BITAND(x.tx_flags, 1024) <> 0 THEN 'B' ELSE '-' END) || (CASE WHEN BITAND(r.flags, 524288) <> 0 THEN 'P' ELSE '-' END) || (CASE WHEN BITAND(r.flags, 256) <> 0 THEN 'X' ELSE '-' END) || '-' || (CASE WHEN BITAND(r.flags, 8192) <> 0 THEN 'F' WHEN BITAND(r.flags, 512) <> 0 THEN 'D' WHEN BITAND(r.flags, 2097152) <> 0 THEN 'B' WHEN BITAND(r.flags, 128) <> 0 THEN 'M' ELSE '-' END)) AS flags, r.sid AS sessid, r.username AS username, s.tty, LOWER(TRIM(LEADING '0' FROM SUBSTR(HEX(th.th_conwait), 3))) AS wait, r.timeout AS tout, r.nlocks AS locks, r.nreads, r.nwrites FROM sysmaster:sysrstcb r, OUTER sysmaster:systhreads th, OUTER sysmaster:systrans x, OUTER sysmaster:syssessions s WHERE th.th_addr = r.mttcb AND x.tx_addr = r.txp AND s.sid = r.sid AND r.address <> 0 ORDER BY r.sid; On 10/22/2026 6:47 PM, Paul Watson via IBM Community wrote: Not tested ..... at all ... in anyway .... DATABASE sysmaster; SELECT HEX(r.address) AS address, ... -posted to the "Informix" group