select tablespace_name,total_mb,used_mb,free_mb,used_pct from (
select t.tablespace_name,t.total_mb,t.total_mb-f.total_free_mb used_mb,total_free_mb free_mb,
to_char((1-(f.total_free_mb/t.total_mb))*100,'990.99')||'%' as used_pct
from
(select tablespace_name,round(sum(bytes)/(1024*1024)) total_mb
from dba_data_files group by tablespace_name) t,
(select tablespace_name,round(sum(bytes)/(1024*1024)) total_free_mb
from dba_free_space group by tablespace_name) f
where t.tablespace_name = f.tablespace_name
);