分析语句:
SQL>analyze index
分析表:
analyze table tablename compute statistics;
analyze index indexname compute statistics;
查看索引碎片的情况:
SQL>select name,del_lf_rows_len,lf_rows_len,(del_lf_rows_len/lf_rows_len)*100 from index_stats;
索引碎片率:(del_lf_rows_len/lf_rows_len)*100
如果索引碎片率超过 20%,oracle 就会认为索引碎片已经非常严重,此时就需要对索引碎片进行整理。
2、索引碎片整理
索引碎片整理包括两种策略:
(1)重建索引(rebuild)
SQL>alter index
(2)压缩索引(coalesce)
SQL>alter index
oracle 建议定期分析之后采用重建索引(rebuild)的策略。
来源: http://www.bubuko.com/infodetail-2453996.html