Saturday, August 16, 2008

TEMP tablespace usage

#TEMP tablespace usage
column tablespace format a12
column username format a12
break on username nodup skip 1
select se.username
,se.sid
,su.extents
,su.blocks * to_number(rtrim(p.value)) as Space
,tablespace
,segtype
from v$sort_usage su
,v$parameter p
,v$session se
where p.name = 'db_block_size'
and su.session_addr = se.saddr
order by space , se.username, se.sid;