online创建索引和重建索引
来源:互联网 发布:手机摇晃解锁软件 编辑:程序博客网 时间:2024/06/05 12:02
加online这个参数,这个参数加上以后,除了create过程中index 保持online状态,Oracle还会在create index之前等待所有DML操作结束,然后得到DDL锁,
开始create.
SQL> create index t1 on test(id) online;
————————————————————————————————
一、重建索引的前提
1、表上频繁发生update,delete操作;
2、表上发生了alter table ..move操作(move操作导致了rowid变化)。
二、重建索引的标准
1、索引重建是否有必要,一般看索引是否倾斜的严重,是否浪费了空间, 那应该如何才可以判断索引是否倾斜的严重,是否浪费了空间, 对索引进行结构分析(如下):
SQL>Analyze index index_name validate structure;
2、在执行步骤1的session中查询index_stats表,不要到别的session去查询。
SQL>select height,DEL_LF_ROWS/LF_ROWS from index_stats;
说明:当 查询出来的 height>=4 或者 DEL_LF_ROWS/LF_ROWS>0.2 的场合 , 该索引考虑重建 。
举例: (t_gl_assistbalance 26 万多条信息 )
SQL> select count(*) from t_gl_assistbalance ;
输出结果:
COUNT(*)
----------
265788
SQL> Analyze index IX_GL_ASSTBAL_1 validate structure;
Index analyzed
SQL> select height,DEL_LF_ROWS/LF_ROWS from index_stats;
输出结果:
HEIGHT DEL_LF_ROWS/LF_ROWS
---------- -------------------
4 1
————————————----、2 、直接重建:
举例:
alter index indexname rebuild; 或alter index indexname rebuild online;
- online创建索引和重建索引
- Oracle创建/重建和删除索引
- Oracle创建、重建和删除索引
- 合并索引和重建索引
- 重建和失效索引
- 重建和维护索引
- MySQL 创建索引、重建索引、查询索引、删除索引
- Oracle 创建索引、重建索引、删除索引的语法
- Oracle 创建索引、重建索引、删除索引的语法
- MySQl创建、删除、重建和查看索引命令
- MySQL创建、删除、重建和查看索引命令
- 查找索引碎片和重建索引
- 索引什么时候重建和重建方法讨论
- 索引什么时候重建和重建方法讨论
- 索引什么时候重建和重建方法讨论
- Oracle索引失效和重建
- 重建smon_scn_time表和索引
- 重建索引
- AngularJS + Ionic 下拉刷新
- ContextLoaderListener初识
- MaxScale 安装
- Hadoop 新旧MapReduce API比较
- HBase工作原理学习
- online创建索引和重建索引
- 【HDU1181】变形课(并查集)
- Android动画效果translate、scale、alpha、rotate详解
- Codeforces 479E Riding in a Lift
- matlab 绘图入门与实例
- AngularJs强制操作DOM
- ReactNative 环境搭建
- App和启动图片的几种设置方法
- Android Studio调试技巧