×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Oracle: All versions FAQ

SQL Scripts

whoson.sql - Display stats on all users. by Michael42
Posted: 17 Oct 06 (Edited 17 Oct 06)

CODE

set echo off
-- whoson.sql
-- Purpose: Display stats on all users logged on to database.
-- -----------------------------------------------------------------------------   
set pagesize 9999
set linesize 200
col username        format a12
col sid             format 999
col serial#         format 99999
col process         format a13
col status          format a10
col machine         format a25
col login_time      format a20
col server_proc_pid format a15
col cmd             format 999
col last_call_min   format 999999.99
col log_time        format a14
col blksRead        format 999,999,999,999  

SELECT a.username, a.sid, a.serial#, a.process, a.status, a.machine, to_char(a.logon_time, 'mm/dd HH24:mi:SS') login_time,
       b.spid server_proc_pid, a.command cmd,a.last_call_et/60 "last_call_min",c.block_gets+c.consistent_gets blksRead
FROM  v$session a, v$process b, v$sess_io c
WHERE a.paddr = b.addr
AND a.sid = c.sid
AND a.username IS NOT NULL
ORDER BY username
/
set echo on

Back to Oracle: All versions FAQ Index
Back to Oracle: All versions Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close