Espacio libre por tablespace (Oracle 8) | ExpoDBA

Espacio libre por tablespace (Oracle 8)

Espacio libre por tablespace (Oracle 8)

set pages 999
col tablespace_name format a40
col "size MB" format 99999999
col "free MB" format 99999999
col "% Used" format 99
select 	tbs_used.tablespace_name, ceil(tbs_used.used_mb) "size MB"
,	decode(ceil(tbs_free.free_mb), NULL,0,ceil(tbs_free.free_mb)) "free MB"
,	decode(100 - ceil(tbs_free.free_mb/tbs_used.used_mb*100), NULL, 100,
               100 - ceil(tbs_free.free_mb/tbs_used.used_mb*100)) "% used"
from	
(select tablespace_name, sum(bytes)/1024/1024 used_mb
	from 	dba_data_files group by tablespace_name) tbs_used
,	(select tablespace_name, sum(bytes)/1024/1024 free_mb
	from 	dba_free_space group by tablespace_name) tbs_free
where	tbs_used.tablespace_name = tbs_free.tablespace_name (+)
and tbs_used.tablespace_name like '&Tablespace'
order	by 4
/