SELECT TSU.TABLESPACE_NAME , |
CEIL(TSU.USED_MB) "size MB" , |
DECODE(CEIL(TSF.FREE_MB), NULL ,0,CEIL(TSF.FREE_MB)) "free MB" , |
DECODE(100 - CEIL(TSF.FREE_MB/TSU.USED_MB*100), NULL , 100, 100 - CEIL(TSF.FREE_MB/TSU.USED_MB*100)) "% used" |
FROM |
( SELECT TABLESPACE_NAME, |
SUM (BYTES)/1024/1024 USED_MB |
FROM DBA_DATA_FILES |
GROUP BY TABLESPACE_NAME |
UNION ALL |
SELECT TABLESPACE_NAME ¦¦ ' **TEMP**' , |
SUM (BYTES)/1024/1024 USED_MB |
FROM DBA_TEMP_FILES |
GROUP BY TABLESPACE_NAME |
) TSU , |
( SELECT TABLESPACE_NAME, |
SUM (BYTES)/1024/1024 FREE_MB |
FROM DBA_FREE_SPACE |
GROUP BY TABLESPACE_NAME |
) TSF |
WHERE TSU.TABLESPACE_NAME = TSF.TABLESPACE_NAME (+) |
ORDER BY 4 / |
No comments:
Post a Comment