— show_sess.sql
— mdw 03/09/02
— summary of sessions logged on
set pages 32
set pause on
accept bground char prompt ‘ignore background (Yy)?> ‘
col sid      form 999
col username form a10 word wrap head user/pid
col osuser   form a8 word wrap
col program  form a20 word wrap
col machine  form a12 word wrap
col logon    form a13
spool show_sess.lst
select sid
      ,nvl(username,process) username
      ,osuser
      ,substr(server,1,3) svr
      ,program||’ ‘||module  program
      ,machine
      ,to_char(logon_time,’ddmm hh24:mi:ss’) logon
from v$session
where type != decode (upper(‘&bground’),’Y’,’BACKGROUND’
                                       ,    ‘ERIC’)
order by sid
/
spool off
clear col

— EOF