Gather statistics about objects(통계정보 생성)
- Gather(통계수집 실행 )
-> ALL(전체) : DBMS_UTILITY.[ANALYZE_DATABASE / ANALYZE_SCHEMA]
-> By table(테이블별) : DBMS_STATS.gather_table_stats
(ex) exec dbms_stats.gather_table_stats(ownname=> 'HR', tabname => 'DEPT', cascade => TRUE,
block_sample=>false , method_opt=>'for all columns size 1',
granularity=>'GLOBAL', no_invalidate=> FALSE,
estimate_percent => 0.01, degree=>16);
- 확인
-> Table : select table_name, num_rows, chain_cnt, blocks, empty_blocks,
avg_space, avg_row_len, last_analyzed
from ALL_TABLES;
Index : select table_name, index_name, status, num_rows, leaf_blocks, blevel, last_analyzed
from ALL_INDEXES;
-> History : select * FROM all_tab_stats_history WHERE table_name = 'DEPT';