Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: User Connections

Re: User Connections

From: DriftWood <drift_wood_at_my-deja.com>
Date: 2000/02/16
Message-ID: <88eh99$dqt$1@nnrp1.deja.com>#1/1

SET ECHO off
REM NAME: TFSCNTIM.SQL
REM USAGE:"@path/tfscntim"

REM --------------------------------------------------------------------


REM REQUIREMENTS:
REM SELECT on V$SESSTAT, V$SESSION, V$TIMER
REM --------------------------------------------------------------------


REM AUTHOR:
REM Anonymous
REM Copyright 1996, Orqacle Corporation
REM --------------------------------------------------------------------


REM PURPOSE:
REM Determines the proper connect time for users
REM --------------------------------------------------------------------


REM EXAMPLE:
REM SID USERNAME CNT
REM    ---------- ------------------------------ --------------------
REM             1                                21-mar-97 09:17:39
REM             2                                21-mar-97 09:17:39
REM             3                                21-mar-97 09:17:39
REM             4                                21-mar-97 09:17:39
REM             5                                21-mar-97 09:17:39
REM             6 SYSTEM                         02-aug-96 10:31:33
REM             7 SYSTEM                         02-aug-96 12:34:13
REM            15 SYS                            21-mar-97 09:17:39
REM
REM --------------------------------------------------------------------


REM DISCLAIMER:
REM This script is provided for educational purposes only. It is NOT REM supported by Oracle World Wide Technical Support. REM The script has been tested and appears to work as intended. REM You should always run new scripts on a test instance initially.
REM --------------------------------------------------------------------


REM Main text of script follows:

column cnt format a20
select s.sid, s.username,
to_char((sysdate-(hsecs - value )/(100*60*60*24)),'dd-mon-yy hh:mi:ss') cnt
from v$sesstat sess, v$session s, v$timer where statistic# = 13 and s.sid = sess.sid
/



Examples:
       SID USERNAME                       CNT

---------- ------------------------------ --------------------
1 21-mar-97 09:17:39 2 21-mar-97 09:17:39 3 21-mar-97 09:17:39 4 21-mar-97 09:17:39 5 21-mar-97 09:17:39 6 SYSTEM 02-aug-96 10:31:33 7 SYSTEM 02-aug-96 12:34:13 15 SYS 21-mar-97 09:17:39

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Feb 16 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US