oracle查看索引所在表空间及索引重建

select index_name,tablespace_name from dba_indexes where index_name='INDEX_PS';

移动

alter index INDEX_PS rebuild tablespace product;

对索引INDF5进行分析
analyze index INDF5 validate structure;

从视图INDEX_STATS中获取INDF5的统计信息

select height,(del_lf_rows_len/lf_rows_len)*100 from index_stats where name='INDF5';

重建依据
(del_lf_rows_len/lf_rows_len)*100的值大于20
height的值大于4(说明二叉树的层次太多)

如果有上述两种情况,则需考虑重建索引

alter index INDF5 rebuild;

猜你喜欢

转载自blog.csdn.net/huangbaokang/article/details/94427408