SELECT
A.TABLESPACE_NAME "테이블스페이스명",
(A.BYTES - B.FREE) "사용공간",
B.FREE "여유 공간",
A.BYTES "총크기",
TO_CHAR( (B.FREE / A.BYTES * 100) , '999.99')||'%' "여유공간"
FROM
(
SELECT FILE_ID,
TABLESPACE_NAME,
SUBSTR(FILE_NAME,1,200) FILE_NM,
SUM(BYTES) BYTES
FROM DBA_DATA_FILES GROUP BY FILE_ID,TABLESPACE_NAME,SUBSTR(FILE_NAME,1,200) ) A,
(
SELECT
TABLESPACE_NAME,
FILE_ID,
SUM(NVL(BYTES,0)) FREE
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;
A.TABLESPACE_NAME "테이블스페이스명",
(A.BYTES - B.FREE) "사용공간",
B.FREE "여유 공간",
A.BYTES "총크기",
TO_CHAR( (B.FREE / A.BYTES * 100) , '999.99')||'%' "여유공간"
FROM
(
SELECT FILE_ID,
TABLESPACE_NAME,
SUBSTR(FILE_NAME,1,200) FILE_NM,
SUM(BYTES) BYTES
FROM DBA_DATA_FILES GROUP BY FILE_ID,TABLESPACE_NAME,SUBSTR(FILE_NAME,1,200) ) A,
(
SELECT
TABLESPACE_NAME,
FILE_ID,
SUM(NVL(BYTES,0)) FREE
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;
'ORACLE' 카테고리의 다른 글
[ORACLE] DB 테이블 명세서 출력 쿼리(Oracle Table Report ) (0) | 2010.06.25 |
---|---|
[ORACLE] 테이블정의서 만들기 쿼리 (0) | 2010.06.25 |
[oracle] 모니터링 sql (0) | 2010.05.10 |
테이블스페이스의 단편화 현상 점검 (0) | 2010.04.14 |
[ORACLE] 점검 목록 (0) | 2010.04.14 |