Posted on 2010-01-14 21:52
斷點(diǎn) 閱讀(1057)
評論(0) 編輯 收藏 所屬分類:
Oracle
原因:出現(xiàn)這個(gè)問題,可能有人move過表,或者disable 過索引。
1、alter table xxxxxx move tablespace xxxxxxx 命令后,索引就會(huì)失效。
2、alter index index_name unusable,命令使索引失效。
解決辦法:
1、重建索引才是解決這類問題的完全的方法。
alter index index_name rebuild (online);
2、如果是分區(qū)索引只需要重建那個(gè)失效的分區(qū) 。
alter index index_name rebuild partition partition_name (online);
說明:
1. alter session set skip_unusable_indexes=true;就可以在session級別跳過無效索引作查詢。
2.分區(qū)索引應(yīng)適用user_ind_partitions。
3.狀態(tài)分4種:
N/A說明這個(gè)是分區(qū)索引需要查user_ind_partitions或者user_ind_subpartitions來確定每個(gè)分區(qū)是否可用;
VAILD說明這個(gè)索引可用;
UNUSABLE說明這個(gè)索引不可用;
USABLE 說明這個(gè)索引的分區(qū)是可用的。
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 斷點(diǎn) 閱讀(369) | 評論 (0)