Posted on 2010-01-14 21:52
斷點 閱讀(1057)
評論(0) 編輯 收藏 所屬分類:
Oracle
原因:出現這個問題,可能有人move過表,或者disable 過索引。
1、alter table xxxxxx move tablespace xxxxxxx 命令后,索引就會失效。
2、alter index index_name unusable,命令使索引失效。
解決辦法:
1、重建索引才是解決這類問題的完全的方法。
alter index index_name rebuild (online);
2、如果是分區索引只需要重建那個失效的分區 。
alter index index_name rebuild partition partition_name (online);
說明:
1. alter session set skip_unusable_indexes=true;就可以在session級別跳過無效索引作查詢。
2.分區索引應適用user_ind_partitions。
3.狀態分4種:
N/A說明這個是分區索引需要查user_ind_partitions或者user_ind_subpartitions來確定每個分區是否可用;
VAILD說明這個索引可用;
UNUSABLE說明這個索引不可用;
USABLE 說明這個索引的分區是可用的。
http://www.sudu.cn/info/html/edu/20071225/20526.html
http://blog.oracle.com.cn/html/65/t-122265.html
posted @ 2009-05-19 19:16 斷點 閱讀(369) | 評論 (0)