Espacio ocupado en tablespace temporal | ExpoDBA

Espacio ocupado en tablespace temporal

Espacio ocupado en tablespace temporal

set pagesize 10000
set linesize 133
col tablespace format a15 heading 'Tablespace Name'
col "Mb OCUP" format 9999999999.99
col username format a15
col osuser format a15
col "% ocupado" format 99.99
select 
	b.tablespace, 
	sum(b.blocks)*8/1024 "Mb OCUP",
	(select sum(bytes)/1024/1024  from dba_data_files 
	where tablespace_name = b.tablespace group by tablespace_name ) "Mb Total",
	sum(b.blocks)/(select sum(bytes)/8/1024  from dba_data_files 
	where tablespace_name = b.tablespace group by tablespace_name )*100 "%",
	a.sid,
	a.serial#,
	a.username,
	a.osuser,
	a.status
from 
	V$SESSION a,
	V$SORT_USAGE b
where 
	a.saddr = b.session_addr 
group by b.tablespace, 	a.sid,	a.serial#, a.username,	
a.osuser, a.status,  sql_hash_value
order by 1, 2;