select /*+ ORDERED use_nl(a b)*/b.tablespace_name,
trunc(sum(b.bytes/1024/1024),2) "FREE(M)",
trunc(sum(a.bytes/1024/1024)-sum(b.bytes/1024/1024),2) "USED(M)",
trunc(sum(a.bytes/1024/1024),2) "ALL(M)"
from dba_data_files a
join dba_free_space b on(a.file_id=b.file_id)
group by b.tablespace_name;
trunc(sum(b.bytes/1024/1024),2) "FREE(M)",
trunc(sum(a.bytes/1024/1024)-sum(b.bytes/1024/1024),2) "USED(M)",
trunc(sum(a.bytes/1024/1024),2) "ALL(M)"
from dba_data_files a
join dba_free_space b on(a.file_id=b.file_id)
group by b.tablespace_name;