mem_usage2.sql
col TOTAL heading 'Total|Memory Usage' format 999,999,999 compute sum of TOTAL on report break on report select NVL(vs.username,'ORACLE') "USER", SUM(se.value) TOTAL from v$sesstat se, v$statname n, v$session vs where n.statistic# = se.statistic# and n.name in ('session pga memory max' ) and vs.sid = se.sid group by vs.username order by 2 desc /