Re: Q:How to find list user sessions with database
Posted in 1998
CONWAY Graham wrote:
>
> Hi,
>
> Please excuse me if this is obvious.
>
> Does anyone have a simple way (sysmaster query or onstat option) of listing
> the sessions on a server and the database they are currently connected to.
>
> I have a script that does it by going through the onstat -u output and
> calling onstat -g sess <sessid> for each session, but there must be a
> quicker way.
A quick scan of $INFORMIXDIR/etc/sysmaster.sql reveals there are two
potential tables which contain a database name together with a session
id:
sysopendb
syssqlstat
You can join these to syssessions or syssesprof, or whatever takes your
fancy, via the session id.
Hope that helps,
--
Mark.
+----------------------------------------------------------+-----------+
|Mark D. Stock - Informix SA http://www.informix.com |//////// /|
|mailto:mdstock@informix.com http://www.iiug.org |///// / //|
| +-----------------------------------+//// / ///|
| Tel: +27 11 807 0313 |If it's slow, the users complain. |/// / ////|
| Fax: +27 11 807 2594 |If it's fast, the users keep quiet.|// / /////|
|Cell: +27 83 250 2325 |Therefore, "No news: travels fast"!|/ ////////|
+----------------------+-----------------------------------+-----------+