--테이블스페이스 사용량 사이즈 확인
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
-- 계정별 default tablespace로 확인
SELECT USERNAME,DEFAULT_TABLESPACE
FROM DBA_USERS
WHERE ACCOUNT_STATUS='OPEN'
AND DEFAULT_TABLESPACE='SYSTEM'
--SYSTEM TABLESPACE에 저장된 OBJECT 확인
SELECT OWNER, SEGMENT_NAME,SEGMENT_TYPE, BYTES FROM DBA_SEGMENTS
WHERE TABLESPACE_NAME ='SYSTEM'
AND OWNER NOT IN ('SYS','SYSTEM')
'DB 관리 TIP' 카테고리의 다른 글
[MS-SQL]세션확인 (0) | 2023.11.14 |
---|---|
[ORACLE]현재 실행 중인 쿼리 (0) | 2023.11.09 |
[MS-SQL] 실행창(cmd) 접속 및 문자열 날짜 변환 (0) | 2021.12.24 |
[ROLE에 부여된 권한 확인] (0) | 2021.12.23 |
결합인덱스 선택도 (0) | 2021.12.16 |