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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Currently log-in users

Re: Currently log-in users

From: Joe LaCascio <jlacasci_at_wheatonma.edu>
Date: Thu, 11 Apr 2002 08:38:37 -0800
Message-ID: <F001.00441F6F.20020411083837@fatcity.com>

Here's a good starting point. If you want I also have a unix shell script driver for this that does a little more formatting.

set feedback off
set heading off
set timing off
set time off
set echo off
set term off
set pagesize 256
set space 1
column username format a8
column machine format a8
column terminal format a8
column logon_time format a18
column "SESSION ID" format a11
column module heading FORM format a20
spool /tmp/logged_in.lst
select username,

       substr(machine,1,8),
       substr(terminal,1,8),
       to_char(logon_time,'DD-MON-YY HH:MI am') logon_time,
       ''''||sid||','||serial#||'''' "SESSION ID",
       nvl(substr(module,1,20), 'Character session')
from v$session
where type = 'USER' and username != 'SYSTEM'   and username is not null and status != 'KILLED'; spool off

prompt
prompt

spool /tmp/logged_in2.lst
select 'Total Users currently logged in'||' '||count(*) from v$session  where type = 'USER'
   and username != 'SYSTEM';
spool off

spool /tmp/logged_in3.lst
select 'GUI users logged in: '||' '||count(*) from v$session
where machine != ('mufasa')
and username != 'SYSTEM';
spool off
exit

Joe LaCascio
Oracle DBA, Unix Administrator
Wheaton College, MA 508.286.3405

On Thu, 11 Apr 2002, Nguyen, David M wrote:

> How do I check who is currently logging into database, where he is accessing
> from and what he is doing?
>
> Thanks,
> David
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Nguyen, David M
> INET: david.m.nguyen_at_xo.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
> also send the HELP command for other information (like subscribing).
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Joe LaCascio
  INET: jlacasci_at_wheatonma.edu

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Apr 11 2002 - 11:38:37 CDT

Original text of this message

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