ITPub博客

首页 > Linux操作系统 > Linux操作系统 > ORA-01502:索引或这类索引的分区处于不可用状态

ORA-01502:索引或这类索引的分区处于不可用状态

原创 Linux操作系统 作者:蓝魔之恋 时间:2011-10-21 18:42:04 0 删除 编辑
原因: 出现这个问题,可能有人对表进行了move ,compress,或者disable了索引
1. alter table xxxxxx move tablespace xxxxxxx 命令后,索引就会失效。
2. alter index index_name  unusable,命令使索引失效。

解决办法:
1. 重建索引才是解决这类问题的完全的方法。
     alter index index_name rebuild (online);

     或者alter index index_name rebuild;
2. 如果是分区索引只需要重建那个失效的分区 。
     alter index index_name rebuild partition partition_name (online);

     或者alter index index_name rebuild partition partition_name ;

3. 或者改变当前索引的名字。

说明:
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 说明这个索引的分区是可用的。

4. 查询当前索引的状态:select distinct status from user_indexes;

5. 查询那个索引无效:select index_name from  user_indexes where status <> 'valid';

6. 详细讲解可参考:http://www.sudu.cn/info/html/edu/20071225/20526.html。


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8362857/viewspace-709508/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-07-08

  • 博文量
    22
  • 访问量
    41963