col totsiz format 999,999,990 justify c heading 'Total|(MB)'
col avasiz format 999,999,990 justify c heading 'Available|(MB)'
col pctusd format 990 justify c heading 'Pct|Used'
comp sum of totsiz avasiz on report
break on report

select
total.tablespace_name,
total.bytes/1024/1024 totsiz,
nvl(sum(free.bytes)/1024/1024,0) avasiz,
(1-nvl(sum(free.bytes),0)/total.bytes)*100 pctusd
from
(select sum(bytes) bytes,tablespace_name from dba_data_files group by tablespace_name) total,
(select sum(bytes) bytes,tablespace_name from dba_free_space group by tablespace_name) free where
total.tablespace_name = free.tablespace_name(+)
group by
total.tablespace_name,
total.bytes
/