통계정보 갱신 방지
exec dbms_stats.lock_table_stats('HPC_CP','GRADE_LOYALTY_BRAND');
통계정보 LOCK 확인
select * from user_tab_statistics
where stattype_locked='ALL'
통계정보 카피
EXEC dbms_stats.copy_table_stats('HPC_USR', 'TB_RESV_TRX_PT', srcpartname => 'PR_201512', dstpartname => 'PR_201502', FORCE => TRUE );
통계정보 삭제
EXEC DBMS_STATS.DROP_STAT_TABLE( ownname => 'SYSTEM', stattab =>'mystats');
통계정보 restore
exec dbms_stats.restore_table_stats('HPC_USR', 'TB_PCARD_TRX_ITM', '15-MAR-16 12.10.57.754866 PM +09:00', FORCE => TRUE );
통계정보 시점 확인
select TABLE_NAME, STATS_UPDATE_TIME from dba_tab_stats_history where owner = 'SCOTT';
통계정보 기능 비활성화
exec DBMS_SCHEDULER.DISABLE('BSLN_MAINTAIN_STATS_JOB');
비/활성화 확인
SELECT owner,
job_name,
job_type,
enabled
FROM dba_scheduler_jobs
WHERE job_name='BSLN_MAINTAIN_STATS_JOB';
TS_PT_ETC_BRND_SHR_SUM 0
TB_PCARD_TRX_ITM 0
TS_PT_ETC_BRND_SHR_SUM 0
통계정보 카피 쿼리 출력
SELECT 'EXEC DBMS_STATS.COPY_TABLE_STATS('''||TABLE_OWNER||''','''||TABLE_NAME||''',srcpartname => ''P20150128'', dstpartname => '''||partition_name||''', FORCE => TRUE);'
FROM dba_tab_partitions
where table_owner ='PARI'
and table_name NOT in ('TCR_SALE_TRAD_AREA_ITEM','TCR_SALE_TEAM_ITEM','TCR_ORDER_TRAD_AREA_ITEM
','TCR_SALE_TRAD_AREA_ITEM')
AND LAST_ANALYZED is null
통계정보 NULL 값 출력
select TABLE_OWNER,table_name,tablespace_name, count(*) from dba_tab_partitions
where LAST_ANALYZED is null
and table_owner ='PARI'
group by TABLE_OWNER,table_name,tablespace_name
order by 3;
restore syntax
DBMS_STATS.RESTORE_TABLE_STATS (
ownname VARCHAR2,
tabname VARCHAR2,
as_of_timestamp TIMESTAMP WITH TIME ZONE,
restore_cluster_index BOOLEAN DEFAULT FALSE,
force BOOLEAN DEFAULT FALSE,
no_invalidate BOOLEAN DEFAULT to_no_invalidate_type
(GET_PARAM('NO_INVALIDATE')));
'Oracle > 통계정보' 카테고리의 다른 글
Histogram 사용하다가 중지할 경우 발생되는 이슈, 장애처리 (0) | 2022.01.24 |
---|---|
통계정보 (0) | 2022.01.24 |