본문 바로가기
IT/DB

테이블스페이스(Tablespace)별 사용량확인 쿼리(SQL)

by 조병희 2012. 6. 10.

  SELECT d.tn,
         ROUND (total / 1000000) "total(MB)",
         ROUND (free / 1000000) "free(MB)",
         TO_CHAR (ROUND (free / total * 100, 1), '99.9') || '%' rate
    FROM (  SELECT tablespace_name tn, SUM (bytes) total
              FROM dba_data_files
          GROUP BY tablespace_name) d,
         (  SELECT tablespace_name tn, SUM (bytes) free
              FROM dba_free_space
          GROUP BY tablespace_name) f
   WHERE d.tn = f.tn
ORDER BY 4 DESC

댓글