Oracle索引分析
来源:互联网 发布:淘宝祖国版手办好莱污 编辑:程序博客网 时间:2024/05/29 19:41
analyze index时, validate structure和compute statistics的区别?
analyze index index1 validate structure:
analyze index index1 compute statistics:
在分析索引的时候,一般会用到以上二个命令,那么这二个命令是用来干什么呢?
analyze index index1 validate structure:是用来分析索引的数据块是否有坏块,以及根据分析得到的数据(存放在index_stats)來判断索引是否需要重新建立。
什么样的index需要rebuild?
当一个table经常进行DML操作时,它的索引会存在许多block空间的浪费,这是因为index block中的记录只有在全部表示为不可用时, block 才能被加入到freelist中去被重新利用。所以我们需要寻找那些浪费空间很严重的index。
方法是: 1) analyze index index_name validate structure;
2) select (del_lf_rows_len/lf_rows_len)*100 from index_stats where name = :index_name;
3) 如果结果大于20%, 那你的Index就可以被rebuild了。
validate structure有二中模式: online, offline, 默认是offline模式。以offline模式分析时, 会對表加一个4级別的锁(表共享),对run系統可能造成一定的影响。
而online模式则没有表lock的影响,但当以online模式分析时, 在视图index_stats没有统计信息。
analyze index index1 compute statistics:是用来统计index的分析信息,来为CBO服务的。从9i开始,Oracle以建议使用dbms_stats package代替 analyze 了。
监控索引:
alter index index_name monitoring usage;
停止监控索引:
alter index index_name nomonitoring usage;
通过数据字典 V$object_usage 查看是否有使用。
analyze index index1 validate structure:
analyze index index1 compute statistics:
在分析索引的时候,一般会用到以上二个命令,那么这二个命令是用来干什么呢?
analyze index index1 validate structure:是用来分析索引的数据块是否有坏块,以及根据分析得到的数据(存放在index_stats)來判断索引是否需要重新建立。
什么样的index需要rebuild?
当一个table经常进行DML操作时,它的索引会存在许多block空间的浪费,这是因为index block中的记录只有在全部表示为不可用时, block 才能被加入到freelist中去被重新利用。所以我们需要寻找那些浪费空间很严重的index。
方法是: 1) analyze index index_name validate structure;
2) select (del_lf_rows_len/lf_rows_len)*100 from index_stats where name = :index_name;
3) 如果结果大于20%, 那你的Index就可以被rebuild了。
validate structure有二中模式: online, offline, 默认是offline模式。以offline模式分析时, 会對表加一个4级別的锁(表共享),对run系統可能造成一定的影响。
而online模式则没有表lock的影响,但当以online模式分析时, 在视图index_stats没有统计信息。
analyze index index1 compute statistics:是用来统计index的分析信息,来为CBO服务的。从9i开始,Oracle以建议使用dbms_stats package代替 analyze 了。
监控索引:
alter index index_name monitoring usage;
停止监控索引:
alter index index_name nomonitoring usage;
通过数据字典 V$object_usage 查看是否有使用。
- oracle 索引分析
- Oracle索引分析
- Oracle 索引质量分析
- oracle之索引分析
- Oracle 索引原理分析
- oracle索引分析与比较
- Oracle索引分析与比较
- Oracle分析表和索引
- oracle 索引失效分析步骤
- oracle的索引优缺点分析
- Oracle自动分析索引,表
- Oracle分析表和索引
- ORACLE索引重建分析详解
- Oracle索引分析与比较
- oracle分析索引,重建--分析表
- Oracle-表分析和索引分析解读
- [Oracle] ORACLE表与索引的分析及索引重建
- 索引在ORACLE数据库中的应用分析
- U-Boot启动过程完全分析
- C 读文件
- Lucene生成查询的函数调用关系
- IIS的配置
- 正则表达式简介
- Oracle索引分析
- linux下解压命令大全
- UIImagePickerController之打开图片库和相机选择图片修改头像
- LFS学习(7)安装基础软件包
- Oracle数据文件迁移(详细版)
- 我们都一样
- EWS Managed API 介绍
- 为什么要在性能测试中设置考虑时间(Thinking Time)
- Linux中KVM的使用