How long has a session been connected?
Posted in 2000
Topics: Connectivity: ODBC / JDBC / .NET, Server Administration
Hi Family.
In sysmaster:syssessions, there is a column named "connected", which is
commented (in syssessions.sql) to be the time when the session
connected to the server. Unfortunately, this is an integer-type
column, the same type of number as other "timestamps" and does not give
me a clue how many minutes (or hours) a session has been connected.
My motivation is a suspicion that people are opening ODBC sessions and
forgetting about them.
Is there any way to determine:
- The length of time a session has been connected to the server? A
time-stamp of the connect time will be fine.
- The time of the most recent databse activity of s specified session.
Good heavens! Even onstat -g ses <session id> does not give me this
information!
Thanks.
--
+----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
|------------------- Bulletin Board Announcement ----------------------|
| Congregants will please note that the bowl at the back of the church |
| bearing the sign "For the Sick" is for monetary contributions only. |
+----------------------------------------------------------------------+
Sent via Deja.com http://www.deja.com/
Before you buy.
Does onstat -g ntt give you the information you're looking for?
Derek Runstadler
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
onstat -g ntt
Jacob Salomon wrote:
>
> Hi Family.
>
> In sysmaster:syssessions, there is a column named "connected", which is
> commented (in syssessions.sql) to be the time when the session
> connected to the server. Unfortunately, this is an integer-type
> column, the same type of number as other "timestamps" and does not give
> me a clue how many minutes (or hours) a session has been connected.
>
> My motivation is a suspicion that people are opening ODBC sessions and
> forgetting about them.
>
> Is there any way to determine:
> - The length of time a session has been connected to the server? A
> time-stamp of the connect time will be fine.
> - The time of the most recent databse activity of s specified session.
>
> Good heavens! Even onstat -g ses <session id> does not give me this
> information!
>
> Thanks.
> --
> +----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
> |------------------- Bulletin Board Announcement ----------------------|
> | Congregants will please note that the bowl at the back of the church |
> | bearing the sign "For the Sick" is for monetary contributions only. |
> +----------------------------------------------------------------------+
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
This is what I use to get the connected time...
select round((dbinfo('utc_current') - s.connected) / 3600,1)
from sysmaster:syssessions
this gives me connect time in the format nn.d hours connected
HTH
Ben Draper
"Jacob Salomon" <JSalomon@bn.com> wrote in message
news:8iqn6k$a8n$1@nnrp1.deja.com...
> Hi Family.
>
> In sysmaster:syssessions, there is a column named "connected", which is
> commented (in syssessions.sql) to be the time when the session
> connected to the server. Unfortunately, this is an integer-type
> column, the same type of number as other "timestamps" and does not give
> me a clue how many minutes (or hours) a session has been connected.
>
> My motivation is a suspicion that people are opening ODBC sessions and
> forgetting about them.
>
> Is there any way to determine:
> - The length of time a session has been connected to the server? A
> time-stamp of the connect time will be fine.
> - The time of the most recent databse activity of s specified session.
>
> Good heavens! Even onstat -g ses <session id> does not give me this
> information!
>
> Thanks.
> --
> +----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
> |------------------- Bulletin Board Announcement ----------------------|
> | Congregants will please note that the bowl at the back of the church |
> | bearing the sign "For the Sick" is for monetary contributions only. |
> +----------------------------------------------------------------------+
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
In article <8iqn6k$a8n$1@nnrp1.deja.com>,
JSalomon@bn.com wrote:
> Hi Family.
>
> In sysmaster:syssessions, there is a column named "connected", which
is
> commented (in syssessions.sql) to be the time when the session
> connected to the server. Unfortunately, this is an integer-type
> column, the same type of number as other "timestamps" and does not
give
> me a clue how many minutes (or hours) a session has been connected.
datetime( 1970-01-01 00:00:00 ) year to second +
connected units second
will give you GMT time of connection
>
> My motivation is a suspicion that people are opening ODBC sessions and
> forgetting about them.
>
> Is there any way to determine:
> - The length of time a session has been connected to the server? A
> time-stamp of the connect time will be fine.
> - The time of the most recent databse activity of s specified
session.
>
> Good heavens! Even onstat -g ses <session id> does not give me this
> information!
>
> Thanks.
> --
> +----- Jacob Salomon - DBA JSalomon@bn.com -
--------------------------+
> |------------------- Bulletin Board Announcement
----------------------|
> | Congregants will please note that the bowl at the back of the church
|
> | bearing the sign "For the Sick" is for monetary contributions only.
|
>
+----------------------------------------------------------------------+
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
--
Vardan Aroustamian
vaar@geocities.com
Sent via Deja.com http://www.deja.com/
Before you buy.
Connected is in UNIX clock time in GMT (UTC). See the two alternate formats
proposed by others for converting to a datetime or timestring using SQL or
pass it to asctime() or localtime() in ESQL/C.
Jacob Salomon wrote:
>
> Hi Family.
>
> In sysmaster:syssessions, there is a column named "connected", which is
> commented (in syssessions.sql) to be the time when the session
> connected to the server. Unfortunately, this is an integer-type
> column, the same type of number as other "timestamps" and does not give
> me a clue how many minutes (or hours) a session has been connected.
>
> My motivation is a suspicion that people are opening ODBC sessions and
> forgetting about them.
>
> Is there any way to determine:
> - The length of time a session has been connected to the server? A
> time-stamp of the connect time will be fine.
> - The time of the most recent databse activity of s specified session.
>
> Good heavens! Even onstat -g ses <session id> does not give me this
> information!
>
> Thanks.
> --
> +----- Jacob Salomon - DBA JSalomon@bn.com - --------------------------+
> |------------------- Bulletin Board Announcement ----------------------|
> | Congregants will please note that the bowl at the back of the church |
> | bearing the sign "For the Sick" is for monetary contributions only. |
> +----------------------------------------------------------------------+
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Related threads
- Posting from the Informix-list
- Migrating from IDS 9.40.UC6 to 11.50.UC3
- Ip for a network session
- questions onstat -g