Show information for all sessions


set feedback off
alter session set nls_date_format='DD-MON-YYYY HH24:MI:SS';
set feedback on

column username format a15 heading 'User Name'
column osuser format a12 heading 'OS User'
column sid format 99999 heading 'Session|ID'
column serial# heading 'Serial #'
column spid format 99999 heading 'SPID'
column status heading 'Status'
column pgaKB heading 'PGA(KB)'
column module format a20 heading 'Module'
column machine format a12 heading 'Machine'
column program format a20 heading 'Program'
column logon_Time format a12 heading 'Log On Time'

set linesize 500
set pagesize 1000

select a.username,
a.osuser,
a.sid,
a.serial#,
d.spid,
a.status,
trunc(b.value/1024) pgaKB,
a.module,
a.machine,
a.program,
a.logon_Time
from v$session a,
v$sesstat b,
v$statname c,
v$process d,
v$statname f
where a.paddr = d.addr
and a.sid = b.sid
and b.statistic# = c.statistic#
and c.name = 'session pga memory'
and f.name = 'session uga memory'
order by 1,2
;