문서유형ㅣ기술정보
분야ㅣ모니터링/점검
적용제품버전ㅣTibero6, Tibero7
문서번호ㅣTMOTI049
개요
본 문서는 인덱스 정합성 검증(DBMS_VERIFY)에 사용되는 내부 로직을 안내합니다.
방법
매커니즘
dbms_verify.table_index를 수행하면 아래와 같이 내부 쿼리가 수행됩니다.
1.Table Full Scan rows - Index Full scan rows
select index_col_name,rid
from (
select /*+full(t) t.index_col_name, t.rowid as rid
from table_name t
where t.index_col_name is not null
minus
select /*+index(t t_idx01) */ t.index_col_name, t.rowid
from table_name t
where t.index_col_name is not null
);
2. Index Full scan rows - Table Full Scan rows
select index_col_name,rid
from (
select /*+full(t) t.index_col_name, t.rowid as rid
from table_name t
where t.index_col_name is not null
minus
select /*+index(t t_idx01) */ t.index_col_name, t.rowid
from table_name t
where t.index_col_name is not null
);
두 쿼리의 수행 결과 값이 0 rows 인 경우 인덱스가 정상이라고 판단합니다.
값이 존재하는경우 비정상(Inconsistant)라고 판단합니다.
- table has more rows than index. 테이블 rows가 인덱스보다 많은 경우
- index has more rows than table. 인덱스 rows가 테이블보다 많은 경우
인덱스의 정합성이 훼손되는 원인은 버전에 따라 상이하며 분석을 위해서는 필요한 로그 및 덤프들을 추출한 후 기술문의가 필요합니다.
주의
exec dbms_verify.table_index('스키마명','테이블명'):
또는 위의 방법을 사용할 때 테이블과 인덱스가 대용량일 경우
쿼리를 수행하는 동안의 읽기 일관성 보장을 위한 undo 공간의 확보 및
MINUS 연산에 수반되는 대규모 정렬 및 중복 제거를 위한 temp 공간의 확보 필수