RE: Session begin time
Posted in 2000
We use the following script on our UNIX-based IDS 7.3x systems.
The exporting of "DELIMDENT=1" allows the use of mixed case column headings.
Another option for "nice looking" headers is to unload data to a file and
display the output with another tool like "awk".
Good luck.
Rick
#!/usr/bin/ksh
#
# Script: sessions.sh
# PURPOSE: Show active Informix sessions with user, database, start time
# USAGE: sessions.sh
#
# SAMPLE DISPLAY:
#
# sid user database tty start_time_pdt pid
#
# 97 busobj busobj IVSD58004 1998-08-28 13:25 235
# 98 busobj busobj IVSD58004 1998-08-28 13:26 235
# 266 rbernste sysmaster 1998-08-29 14:59 28352
#
export DELIMIDENT=1
TIMEZONE=`date +%Z` # Get time zone from UNIX
$INFORMIXDIR/bin/dbaccess sysmaster 2>/dev/null <<-EOF!
SET PDQPRIORITY OFF; SELECT LPAD(sid,9,' ') " sid ", -- Informix session id
username AS "User", -- User name
sqs_dbname[1,16] AS "Database", -- Database name
tty, -- Workstation name
EXTEND (dbinfo('UTC_TO_DATETIME',connected), YEAR TO MINUTE)
AS "Start_Time_$TIMEZONE",
LPAD(pid,6,' ') AS " pid" -- UNIX process id
FROM syssessions, syssqlstat
WHERE sid = sqs_sessionid
AND sid != dbinfo('sessionid') -- Exclude this session
ORDER BY 5 DESC, 1;
EOF!
-----Original Message-----
From: Aboobacker V V [mailto:aboo@syd-co.au.dhl.com]
Sent: Wednesday, August 02, 2000 19:46
To: informix-list@iiug.org
Subject: Session begin time
Hi All,
How to identify the start time of a session. Plese help.
Regards
Aboo