REM retention 기간 확인
select DBMS_STATS.GET_STATS_HISTORY_RETENTION from dual;
REM restore가 가능한 가장 오래된 날짜 확인.
select DBMS_STATS.GET_STATS_HISTORY_AVAILABILITY from dual;
REM 특정 table의 statistics history 확인
select OWNER,TABLE_NAME,PARTITION_NAME, STATS_UPDATE_TIME from dba_tab_stats_history where table_name = '&TABLE_NAME' order by STATS_UPDATE_TIME;
REM 통계정보 restore.
-- execute DBMS_STATS.RESTORE_TABLE_STATS ('owner','table',date)
-- execute DBMS_STATS.RESTORE_DATABASE_STATS(date)
-- execute DBMS_STATS.RESTORE_DICTIONARY_STATS(date)
-- execute DBMS_STATS.RESTORE_FIXED_OBJECTS_STATS(date)
-- execute DBMS_STATS.RESTORE_SCHEMA_STATS('owner',date)
-- execute DBMS_STATS.RESTORE_SYSTEM_STATS(date)
예: execute dbms_stats.restore_table_stats ('SCOTT','EMP','25-JUL-07 12.01.20.766591 PM +02:00');
참고: Restoring table statistics in 10G onwards (Doc ID 452011.1)
4. 현재 통계정보 backup
exec dbms_stats.create_stat_table(ownname => 'sys', stattab => 'old_stats3');
exec dbms_stats.export_table_stats(ownname=>'SCOTT',tabname=>'EMP', stattab=>'old_stats3',statown => 'SYS');'Oracle로 먹고살기' 카테고리의 다른 글
| ORACLE 과거 통계정보 restore 하기. (1) | 2012/05/26 |
|---|---|
| Oracle 11g로 upgrade 해야 하는 이유.. (0) | 2012/05/26 |
| Oracle Multitable inserts - INSERT ALL & INSERT FIRST (0) | 2011/10/21 |
| Oracle V$LOCK을 query할때는 ordered hint를 사용하자? (0) | 2011/08/31 |
| oracle index_stats view의 del_lf_rows column값을 이용한 index rebuild 방안 (0) | 2011/08/30 |
| Oracle alert log의 날짜와 로그 내용을 한줄로 보기 (0) | 2011/07/29 |


댓글을 달아 주세요
한국드라마를 보는 것은