ORACLE使索引变成不可用的状态:
alter index index_name unusable;
执行成功后,如果后续需要再用到该索引的话,就必须重建。重建后会自动变成usable。
根据ORACLE官方文档的说法(An unusable index must be rebulit , or dropped and re-created , before it can be used.)
重建有两种方式
1. rebuild
   alter index index_name rebuild;
2. drop掉该索引,然后再重建。
   drop index index_name;
   create index index_name on xxxxx;
实际上这两种操作的结果是一样的,都是删除再重新启用,不过rebulid方式更为快捷和简单。

另外,数据库还有两种修改INDEX状态的语句,叫disable和enable;

1. enable index
   alter index index_name enable;
2. disable index
   alter index index_name disable;

两者的区别是:enable和disable仅仅只针对函数索引。
ORACLE官方文档提供的说法是:

ENABLE Clause

Enable applies only to a function-based index that has been disabled because a user-defined function used by the index was dropped or replaced. This clause enables such an index if these conditions are true:

The function is currently valid

The signature of the current function matches the signature of the function when the index was created

The function is currently marked asDETERMINISTIC

Restriction on Enabling Function-based Indexes You cannot specify any other clauses of ALTER INDEX in the same statement with ENABLE.

DISABLE Clause

DISABLE applies only to a function-based index. This clause lets you disable the use of a function-based index. You might want to do so, for example, while working on the body of the function. Afterward you can either rebuild the index or specify another ALTER INDEX statement with the ENABLE keyword.

UNUSABLE Clause

Specify UNUSABLE to mark the index or index partition(s) or index subpartition(s) UNUSABLE. An unusable index must be rebuilt, or dropped and re-created, before it can be used. While one partition is marked UNUSABLE, the other partitions of the index are still valid. You can execute statements that require the index if the statements do not access the unusable partition. You can also split or rename the unusable partition before rebuilding it.

Restriction on Marking Indexes Unusable You cannot specify this clause for an index on a temporary table.

如果发现一个索引失效以后,对其使用enable命令,可能会引发ORA-02243的错误,这是由于ENABLE只针对函数索引有效,可以试试rebuild,如果对一个索引执行失效命令,也可能会遇到这个错误,原因是一样的。
因此,修改你的命令就可以啦~~

oracle 索引 状态 unusable,usable ,disable,enable相关推荐

  1. 查看oracle索引状态,oracle监控索引的使用情况

    1.使用monitor index来监控索引使用 监控单个索引使用情况:alter index monitoring usage; 关闭监控: alter index nomonitoring usa ...

  2. Oracle索引状态查询与索引重建

    --检查损坏索引 SELECT status, COUNT(*)FROM dba_indexesGROUP BY status UNION SELECT status, COUNT(*)FROM db ...

  3. oracle visible,索引列的usable和visible(一)

    索引是Oracle数据库中一个重要的组成部分.Oracle优化和处理很多方面都是围绕索引进行的.在Oracle11g中,索引添加了一个visible属性,来加强对索引的控制能力.今天我们来一起聊聊这个 ...

  4. ORACLE 索引的三种状态: VALID、 N/A 、UNUSABLE

    valid:当前索引有效 N/A  :分区索引有效 unusable:索引失效 Oracle异常ORA-01502: 索引或这类索引的分区处于不可用状态 原因: 出现这个问题,可能有人move过表,或 ...

  5. oracle 索引invisible,Oracle index unusable和invisible的区别

    invisible index会被优化器所忽略,但是dml操作仍然会维护索引.在session或者system级别使用参数OPTIMIZER_USE_INVISIBLE_INDEX 摘录自Oracle ...

  6. ORACLE索引重建方法与索引的三种状态

    一.重建索引的前提 1.表上频繁发生update,delete操作: 2.表上发生了alter table ..move操作(move操作导致了rowid变化). 二.重建索引的标准 1.索引重建是否 ...

  7. oracle数据库disable,Disable/Enable Oracle Database Vault

    一.Disable Oracle Database Vault [oracle@node1 ~]$ sqlplus sys/xifenfei@ora11g as sysdba SQL*Plus: Re ...

  8. ORACLE查看某个表的索引状态

    select status,T.* from user_indexes T where table_name='表名' 如下图: 状态列STATUS说明: valid:当前索引有效           ...

  9. 【Oracle】分区表中索引状态为N/A

    我遇到的问题: 1. 表为range分区加list子分区 2. 表上建本地分区索引 3. dba_ind_partitions中查询索引状态为N/A 4. 即使删除重建索引,状态依旧为N/A 问题解决 ...

  10. oracle索引管理

    这一篇文章我们介绍一下oracle管理索引的手段 索引使用的正确姿势: 如果您经常要查询的数据少于表数据15%,则可以考虑创建索引. 为了提高多个表的连接查询性能,连接的列考虑建索引. 数据量很小的表 ...

最新文章

  1. 24个必须掌握的数据库面试问题~
  2. 小白该如何学习Linux操作系统(2)
  3. Android设备的网络抓包
  4. rhel5下限值用户使用su切换身份
  5. OpenCV isContinuous()连续存储的问题
  6. python都有什么包_常用的Python包有哪些,如何快速掌握Python编程
  7. 织梦php添加函数调用,dedecms自定义函数及实际案例调用
  8. 二十一天学通C语言:使用const声明指针变量
  9. 通过TP-Link路由器WAN口嗅探PPPoE拨号密码-路由器拨号密码破解方法
  10. RiskCloud-基于Markov算法精准的FTA、 JSA、FMEA软件
  11. latex 编译缺少STXingkai字体
  12. 惠普打印机WiFi连接使用
  13. 苹果6swifi温度过高 iphone6s温度过高提醒修复教程
  14. 移动端 Retina屏 各大主流网站1px的解决方案
  15. 基于Spark的公安大数据实时运维技术实践
  16. 这种性生活伤女人尿道
  17. cpolar:一款好用的内网穿透工具 - 无需公网IP
  18. Excel删除指定列(VB)
  19. python opencv3 背景分割 mog2 knn
  20. Windows自动开关机及开机音乐

热门文章

  1. 基于python的博客设计与开发_基于python的博客设计与开发毕业设计
  2. 十进制转换为N进制C语言
  3. java零基础风清扬黑马笔记
  4. 3dmax 2014加载panda3d插件失败
  5. learn git branching
  6. 西门吹雪和他的剑——剑神和剑道
  7. 爬虫是什么?可以用来干什么?
  8. 微信小程序报错“对应的服务器证书无效”
  9. 瑞芯微rv1126/1109软硬件解压缩对比---附:关于内存对齐的那些事
  10. Android Manager之AudioManager(音频管理器)