"Hamid HABZI" <HHABZI@bmcebank.co.ma> wrote in message news:<cane4a$jtv$1@news.xmission.com>...
> Hi,
> How can i know what is the maximum number of sessions in a period of time.
> IDS 7.31.UD6 on AIX 5.1
I use the following SQL against sysmaster:
SELECT COUNT(*) FROM syssessions
WHERE sid != DBINFO('sessionid')
AND is_monitor != 1
;The first WHERE clause eliminates the session performing the count.
The second should eliminate any internal monitoring sessions, but I
have not actually seen any show up, so it may be redundant.
You can also insert the data into a table to store historical data.
Another SQL I use is as follows, which gives a bit more information
(we run this in a report); note that this queries an undocumented
table:
SELECT sid, username, hostname, sqs_dbname, tty, current
FROM syssessions ss,syssqlstat sq
WHERE ss.sid = sq.sqs_sessionid
AND sid != DBINFO('sessionid')
;
onstat -g ses show sessions, including the informix internal sessionswhich do not count for licensing, according to our sales person.
onstat -u shows user threads, which can exceed the number of sessions.
Sincerely,
Christopher Coleman
Database Analyst
Pharmacy Division
Mediware Information Systems, Inc.