반응형
4.3.9 버전에서 테이블 스페이스 사용량 조회 확인 쿼리입니다.
set linesize 1000;
set colsize
20;
SELECT
UF.NAME SPACENAME,
ROUND(DF.MAXSIZE, 3)||' MB'
MAXSIZE ,
ROUND(DF.CURRSIZE, 3)||' MB' CURRSIZE ,
NVL(to_char(ROUND(UF.ALLOCATED_PAGE_COUNT*8/1024,3)),'N/A')||' MB'
USEDSIZE
FROM
(SELECT
SUM(MAXSIZE)*8/1024 MAXSIZE
,
SUM(CURRSIZE)*8/1024 CURRSIZE ,
SPACEID
FROM
V$DATAFILES
GROUP BY SPACEID) DF ,
V$TABLESPACES UF
where DF.SPACEID = UF.ID
UNION ALL
SELECT
'SYS_TBS_MEMORY' SPACENAME,
ROUND(MEM_MAX_DB_SIZE/1024/1024,3)||' MB'
MAXSIZE,
ROUND(MEM_ALLOC_PAGE_COUNT*32/1024,3)||' MB' CURRSIZE,
TO_CHAR(ROUND(MEM_ALLOC_PAGE_COUNT*32/1024,3))||' MB' USEDSIZE
FROM
V$DATABASE
ORDER BY 1;
반응형