Script or SQL statement
Posted in 2012
Topics: Logging & Checkpoints
Hi all Questions 1)Some years ago, I came across an informix (unix script) which uses the smi table to query which user is currently holding the lock on table. Did anyone know where I can download such script? OR alternatively, the equivalent of SQL statement 2) I used the following method to check for the location of each of the my logical logs .. onmonitor --> Status --> Log Did anyone know how can I script it using equivalent SQL statement? Many thanks in advance. Patrick
2) select * from sysmaster:syslogfil; Art Art S. Kagel Advanced DataTools (www.advancedatatools.com) Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Advanced DataTools, the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Sat, Sep 15, 2012 at 8:26 AM, LEY PATRICK <patrickley@gmail.com> wrote: > Hi all > > Questions > 1)Some years ago, I came across an informix (unix script) which uses the > smi > table to query which user is currently holding the lock on table. > > Did anyone know where I can download such script? OR alternatively, the > equivalent of SQL statement > > 2) I used the following method to check for the location of each of the my > logical logs .. onmonitor --> Status --> Log > > Did anyone know how can I script it using equivalent SQL statement? > > Many thanks in advance. > Patrick > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --14dae93411194a13f704c9c6e703
1) SELECT x5.sid AS session, x5.username AS user, x5.hostname AS host, x5.pid AS pid, x1.tabname AS object, CASE WHEN(x0.rowidn = 0) THEN 'T' ELSE 'R' END || x4.txt[1,3] AS type, COUNT(*) :: INT as number, MAX ( CURRENT YEAR TO FRACTION(3) - DBINFO('utc_to_datetime', x0.grtime) ) :: INTERVAL HOUR TO SECOND AS duration FROM syslcktab AS x0, systabnames AS x1, systxptab AS x2, sysrstcb AS x3, flags_text AS x4, syssessions AS x5 WHERE x1.partnum = x0.partnum AND x2.address = x0.owner AND x3.address = x2.owner AND x4.flags = x0.type AND x5.sid = x3.sid AND x1.dbsname != 'sysmaster' AND x4.tabname = 'syslcktab' AND x4.txt NOT LIKE '%I%' GROUP BY 1, 2, 3, 4, 5, 6 ORDER BY 1, 2, 3, 4, 5, 6 Regards, Doug Lawry