SQL> set pagesize 100
SQL> SELECT UPPER(F.TABLESPACE_NAME) "表空间名",
2 D.TOT_GROOTTE_MB "表空间大小(M)",
3 D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空间(M)",
4 TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB * 100,
5 2),
6 '990.99')||'%' "使用比(%)",
7 F.TOTAL_BYTES "空闲空间(M)",
8 F.MAX_BYTES "最大块(M)"
9 FROM (SELECT TABLESPACE_NAME,
10 ROUND(SUM(BYTES) / (1024 * 1024), 2) TOTAL_BYTES,
11 ROUND(MAX(BYTES) / (1024 * 1024), 2) MAX_BYTES
12 FROM SYS.DBA_FREE_SPACE
13 GROUP BY TABLESPACE_NAME) F,
14 (SELECT DD.TABLESPACE_NAME,
15 ROUND(SUM(DD.BYTES) / (1024 * 1024), 2) TOT_GROOTTE_MB
16 FROM SYS.DBA_DATA_FILES DD
17 GROUP BY DD.TABLESPACE_NAME) D
18 WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
19 ORDER BY F.TABLESPACE_NAME;
表空间名 表空间大小(M) 已使用空间(M) 使用比(%) 空闲空间(M) 最大块(M)
---------- ------------- ------------- -------- ----------- ----------
IUFO01 1024 95.25 9.30% 928.75 892
NNC_DATA01 2048 1827.25 89.22% 220.75 220
NNC_DATA02 1024 127.25 12.43% 896.75 896.75
NNC_DATA03 2048 1132 55.27% 916 851.5
NNC_INDEX01 2048 1211.37 59.15% 836.63 836.63
NNC_INDEX02 1024 273.12 26.67% 750.88 750.88
NNC_INDEX03 1024 691.25 67.50% 332.75 243.25
SYSAUX 370 323.37 87.40% 46.63 8.94
SYSTEM 530 513.87 96.96% 16.13 15.19
UNDOTBS1 110 40.31 36.65% 69.69 68.94
USERS 18.75 14.87 79.31% 3.88 3.69