'스페이스'에 해당되는 글 1건
- 2014.03.04 [Oracle] 테이블 스페이스 용량/사용량 산출
[Oracle] 테이블 스페이스 용량/사용량 산출
// TABLESPACE_NAME 별로 합처리
SELECT SUBSTR(A.TABLESPACE_NAME,1,30) TABLESPACE,
ROUND(SUM(A.TOTAL1)/1024/1024,1) "TOTALMB",
ROUND(SUM(A.TOTAL1)/1024/1024,1)-ROUND(SUM(A.SUM1)/1024/1024,1) "USEDMB",
ROUND(SUM(A.SUM1)/1024/1024,1) "FREEMB",
ROUND((ROUND(SUM(A.TOTAL1)/1024/1024,1)-ROUND(SUM(A.SUM1)/1024/1024,1))
/ROUND(SUM(A.TOTAL1)/1024/1024,1)*100,2) "USED%"
FROM
(SELECT TABLESPACE_NAME,0 TOTAL1,SUM(BYTES) SUM1,MAX(BYTES) MAXB,
COUNT(BYTES) CNT
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME
UNION
SELECT TABLESPACE_NAME,SUM(BYTES) TOTAL1,0,0,0
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) A
GROUP BY A.TABLESPACE_NAME
ORDER BY TABLESPACE;
// 전체 합처리
SELECT ROUND(SUM(A.TOTAL1)/1024/1024/1024,1) "TOTALGB",
ROUND(SUM(A.TOTAL1)/1024/1024/1024,1)-ROUND(SUM(A.SUM1)/1024/1024/1024,1) "USEDGB",
ROUND(SUM(A.SUM1)/1024/1024/1024,1) "FREEGB",
ROUND((ROUND(SUM(A.TOTAL1)/1024/1024,1)-ROUND(SUM(A.SUM1)/1024/1024,1))
/ROUND(SUM(A.TOTAL1)/1024/1024,1)*100,2) "USED%"
FROM
(SELECT TABLESPACE_NAME,0 TOTAL1,SUM(BYTES) SUM1,MAX(BYTES) MAXB,
COUNT(BYTES) CNT
FROM DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME
UNION
SELECT TABLESPACE_NAME,SUM(BYTES) TOTAL1,0,0,0
FROM DBA_DATA_FILES
GROUP BY TABLESPACE_NAME) A
'Database / Sql' 카테고리의 다른 글
[Oracle] IO를 많이 발생시키는 쿼리 찾기 (0) | 2014.09.02 |
---|---|
[Oracle] 각 테이블/인덱스 사이즈 조회 쿼리 (0) | 2014.03.06 |
[Oracle] SID, SPID 를 통해 수행하고 있는 쿼리 찾기 (0) | 2013.11.27 |
[Oracle] SYS_CONNECT_BY_PATH 문자열 합치기?? (0) | 2013.10.18 |
[Oracle] 대소문자 처리 (0) | 2013.09.26 |