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,如果对一个索引执行失效命令,也可能会遇到这个错误,原因是一样的。
因此,修改你的命令就可以啦~~

索引unusable|disable|enable相关推荐

  1. mysql表disable_[MySQL优化案例]系列 -- DISABLE/ENABLE KEYS的作用

    [MySQL优化案例]系列 -- DISABLE/ENABLE KEYS的作用 作/译者:叶金荣 来源:http://imysql.cn 转载请注明作/译者和出处,并且不能用于商业用途,违者必究. 有 ...

  2. [MySQL优化案例]系列 -- DISABLE/ENABLE KEYS的作用

    作/译者:叶金荣(Email: ),来源:http://imysql.cn,转载请注明作/译者和出处,并且不能用于商业用途,违者必究. 有一个表 tbl1 的结构如下: CREATE TABLE `t ...

  3. mysql disable keys_MySQL DISABLE/ENABLE KEYS的作用

    由于业务需要,要新建一个从库,由于数据量很大在导入数据的过程中,发现有一个processlist:/*!40000 ALTER TABLE tbl_name ENABLE KEYS */;占用了很长时 ...

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

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

  5. datax优化之reader提速-详细经历

    首先说明下,个人认为reader提速最重要的一点就是切分任务即split这块,懒得看过程的请直接跳到结尾....结尾的json照着抄就行,莫要瞎改,等你跑好了你再改其他参数 背景:一直用datax从o ...

  6. Oracle基础教程文档~超级全

    Oracle文档 基础知识 关于数据库语言的分类 DDL:数据库定义语言:create.drop DML:数据库的操作语言:insert.update.delete DQL:数据库的查询语言:sele ...

  7. 解锁不可见索引新特性,处理ORA-01555故障

    关注"数据和云",精彩不容错过 何国亮 云和恩墨交付部技术顾问,获得 Oracle 11g OCM 认证.有超过 6 年超大型数据库专业服务经验,曾为通信运营商.银行.保险.政府. ...

  8. ORACLE的索引和约束详解

    Oracle的约束 * 如果某个约束只作用于单独的字段,即可以在字段级定义约束,也可以在表级定义约束,但如果某个约束作用于多个字段, 必须在表级定义约束 * 在定义约束时可以通过CONSTRAINT关 ...

  9. oracle数据量大时候分区索引思路

    有一个分区表,按list分区,只有一个本地唯一索引,没有外键和触发器 当单个分区数量在2000万以内时,insert效率还可以,每秒2.3-2.5万条 但数据量越大,速度越慢, 目前单个分区数量达到3 ...

最新文章

  1. 转:ASP.NET状态保存方法
  2. 外键为主键可以重复原因
  3. python字典成绩_python_字典
  4. py-faster-rcnn代码roidb.py的解读
  5. [Vue warn]: Invalid prop: custom validator check failed for prop xxx.问题
  6. 五月两场!! NVIDIA DLI 深度学习入门课程——计算机视觉
  7. Kernel Livepatching示例
  8. sklearn中的train_test_split函数
  9. 2017总结:迷茫的一年
  10. C++ freopen 打开txt文件,读取,写入txt文件
  11. 深入剖析线程同步工具CountDownLatch原理
  12. 【二分图匹配】矩阵游戏
  13. python的信号量机制
  14. ‘大案牍术’告诉你为什么《长安十二时辰》这么火!
  15. BUUCTF RE [SUCTF2019] SignIn
  16. 二叉树算法解题思路总结(一)
  17. 程序员DIY真实版小机器人瓦力 人群之中寻找伊娃
  18. Android studio+SQLCipher加密SQLite数据库的几个坑
  19. 2020.08.06狂人日记:Python项目转C#项目问题
  20. 安卓源码分析(一)目录说明

热门文章

  1. android自定义滚轴选择器_Android自定义滚动式时间选择器(在他人基础上修改)...
  2. 有时间担心中年危机,还不如用忧虑的时间来提升自己——再论程序员该如何避免所谓的中年危机...
  3. [转] Oracle中Blob转Clob
  4. 数据结构线性表博客作业总结
  5. hive中的一些参数
  6. 文本框灰色文字提示,鼠标点击文字消失
  7. Javascript中字符串输出html的动态链接
  8. C++ enum 枚举
  9. 学习3dmax的第二天
  10. 怎么把模组直接装在Java里面_如何使用jythonj将python模块添加到java中