SELECT T.TABLESPACE_NAME “TABLESPACE
NAME”,
TO_CHAR(T.TOTALMB/1048576,’99,999,999.99′) “TOTALMB”,
TO_CHAR(F.FREEMB/1048575,’99,999,999.99′) “FREEMB”,
TO_CHAR((T.TOTALMB-F.FREEMB)/1048576,’99,999,999.99′) “USEDMB”,
TO_CHAR((F.FREEMB/T.TOTALMB)*100,’999.9′) “PCTFREE”,
TO_CHAR(T.MAXMB/1048576,’99,999,999.99′) “MAXMB”, OBJECTS
“TOTAL_OBJECTS” FROM (SELECT TABLESPACE_NAME,SUM(BYTES)
TOTALMB, SUM(MAXBYTES) MAXMB FROM DBA_DATA_FILES GROUP BY
TABLESPACE_NAME) T, (SELECT TABLESPACE_NAME,SUM(BYTES) FREEMB FROM
DBA_FREE_SPACE GROUP BY TABLESPACE_NAME) F, (SELECT
TABLESPACE_NAME,COUNT(*) OBJECTS FROM DBA_SEGMENTS GROUP BY
TABLESPACE_NAME) S WHERE T.TABLESPACE_NAME=F.TABLESPACE_NAME(+) AND
T.TABLESPACE_NAME=S.TABLESPACE_NAME(+);
No comments:
Post a Comment