오라클 테이블 스페이스 확인(Oracle TableSpace)

 

오라클 테이블 스페이스 확인(Oracle TableSpace)

SELECT A.TABLESPACE_NAME, A.FILE_ID,
              ROUND(A.BYTES/1024/1024/1024, 2)||'G' USABLE,
              ROUND( B.BYTES/1024/1024/1024,2)||'G' FREE,
              trunc(100-(B.BYTES/A.BYTES*100),2)||'%' USED_RATE,
              trunc(B.BYTES/A.BYTES*100,2)||'%' FREE_RATE
  FROM ( SELECT TABLESPACE_NAME, FILE_ID, SUM(BYTES) BYTES
                FROM DBA_DATA_FILES
              GROUP BY TABLESPACE_NAME, FILE_ID ) A,
           ( SELECT TABLESPACE_NAME, FILE_ID, SUM(BYTES) BYTES
                FROM DBA_FREE_SPACE
              GROUP BY TABLESPACE_NAME, FILE_ID ) B
 WHERE A.TABLESPACE_NAME = B.TABLESPACE_NAME
     AND A.FILE_ID = B.FILE_ID(+)
 ORDER BY 1;

 

This entry was posted in Database and tagged , , , . Bookmark the permalink.

댓글 남기기