set pagesize 500; set linesize 1000;col PER format a10;col NAME format a20;SELECT UPPER(F.TABLESPACE_NAME) "NAME",D.TOT_GROOTTE_MB "TSIZE(M)",D.TOT_GROOTTE_MB - F.TOTAL_BYTES "USIZE(M)",TO_CHAR(ROUND((D.TOT_GROOTTE_MB - F.TOTAL_BYTES) / D.TOT_GROOTTE_MB 100, 2), '990.99') "PER",F.TOTAL_BYTES "FREE(M)",F.MAX_BYTES "MAX(M)"FROM (SELECT TABLESPACE_NAME,ROUND(SUM(BYTES) / (1024 1024), 2) TOTAL_BYTES,ROUND(MAX(BYTES) / (1024 1024), 2) MAX_BYTESFROM SYS.DBA_FREE_SPACEGROUP BY TABLESPACE_NAME) F,(SELECT DD.TABLESPACE_NAME,ROUND(SUM(DD.BYTES) / (1024 1024), 2) TOT_GROOTTE_MBFROM SYS.DBA_DATA_FILES DDGROUP BY DD.TABLESPACE_NAME) DWHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME ORDER BY 4 DESC;
转载于:https://blog.51cto.com/13032607/2402202