SQL> SELECT
2 tot.tablespace,
3 tot.size_mb,
4 tot.free_mb,
5 ROUND((tot.free_mb/tot.size_mb)*100,2) as “LIVRE(%)”
6 FROM
7 (SELECT total.tablespace_name TABLESPACE,
8 ROUND(total.bytes / 1024/1024,3) as SIZE_MB,
9 ROUND(nvl(sum(free.bytes) / 1024/1024, 0),3) as FREE_MB
10 FROM (SELECT tablespace_name, SUM(bytes) bytes
11 FROM sys.dba_data_files
12 GROUP BY tablespace_name) total,
13 dba_free_space free
14 WHERE total.tablespace_name = free.tablespace_name(+)
15 GROUP BY total.tablespace_name, total.bytes) tot
16 ORDER BY 4 ASC;
TABLESPACE SIZE_MB FREE_MB LIVRE(%)
USERS 433.75 2.938 .68
SYSAUX 220 9.313 4.23
SYSTEM 300 12.813 4.27
UNDOTBS1 400 388.25 97.06
não apace