1 select
2 b.file_id FILEID,
3 b.tablespace_name TBSNAME,
4 b.bytes/1024/1024||'M' SIZES,
5 (b.bytes-sum(nvl(a.bytes,0)))/1024/1024||'M' USED,
6 sum(nvl(a.bytes,0))/1024/1024||'M' FREE,
7 100 - sum(nvl(a.bytes,0))/(b.bytes)*100||'%' PERCENTS
8 from dba_free_space a,
9 dba_data_files b
10 where a.file_id = b.file_id
11 group by b.tablespace_name, b.file_id, b.bytes
12 order by b.file_id;