/* ************************************************ */
/*                                                  */
/* fnctn:   session uga memory max                  */
/*                                                  */
/* name:    @c:\oracle\sql\max_uga.sql              */
/* date:    12-MAY-95                               */
/* creator: Rick Kupcunas (Oracle)                  */
/*                                                  */
/* ************************************************ */

spool max_uga.rslt
set pause on

col username format a20
col value format 999,999,990

break on report

compute sum of value on report
compute avg of value on report

select s.sid sid,
     i.username username,
     s.value value
from v$sesstat s,
     v$statname n,
     v$session i
where s.statistic# = n.statistic# and 
      s.sid        = i.sid        and 
      n.name       = 'session uga memory max' and 
      i.username is not null
order by value desc;

spool off;