[转] Oracle analyze 命令分析
转自:http://blog.sina.com.cn/s/blog_682841ba0101bncp.html
1.analyze table t1 compute statistics for table; -->user_tables
(只对表的总体信息进行统计,比如行数多少等,不涉及到表字段)
2.analyze table t2 compute statistics for all columns; -->user_tab_columns
(只会收集表字段信息)
3.analyze table t3 compute statistics for all indexed columns; -->user_tab_columns
(只会收集表中索引所在的字段信息)
4.analyze table t4 compute statistics for all indexes;à user_indexes
(只收集表索引的信息)
5.analyze table t5 compute statistics;
(收集表,表字段,索引的信息)
另外,可以删除分析数据:
SQL> analyze table my_table delete statistics;
SQL> analyze table my_table delete statistics for table for all indexes for all indexed columns;
例子:
create table t1 as select * from user_objects;
create table t2 as select * from user_objects;
create table t3 as select * from user_objects;
create table t4 as select * from user_objects;
create table t5 as select * from user_objects;
create table t6 as select * from user_objects;
create unique index pk_t1_idx on t1(object_id);
create unique index pk_t2_idx on t2(object_id);
create unique index pk_t3_idx on t3(object_id);
create unique index pk_t4_idx on t4(object_id);
create unique index pk_t5_idx on t5(object_id);
create unique index pk_t6_idx on t6(object_id);
<</B>刚建完表的时候>
(1) 查看表的统计信息
select table_name, num_rows, blocks, empty_blocks
from user_tables
where table_name in ('T1', 'T2', 'T3', 'T4', 'T5','T6');
(2) 查看字段的统计信息
select table_name,
column_name,
num_distinct,
low_value,
high_value,
density
from user_tab_columns
where table_name in ('T1', 'T2', 'T3', 'T4','T5','T6');
(3) 查看索引的统计信息
select table_name,
index_name,
blevel,
leaf_blocks,
distinct_keys,
avg_leaf_blocks_per_key avg_leaf_blocks,
avg_data_blocks_per_key avg_data_blocks,
clustering_factor,
num_rows
from user_indexes
where table_name in ('T1', 'T2', 'T3', 'T4', 'T5', 'T6');
二.执行analyze命令
analyze table t1 compute statistics for table; --针对表收集信息
analyze table t2 compute statistics for all columns; --针对表字段收集信息
analyze table t3 compute statistics for all indexes columns; --收集索引字段信息
analyze table t4 compute statistics; --收集表,表字段,索引信息
analyze table t5 compute statistics for all indexes; --收集索引信息
analyze table t6 compute statistics for table for all indexes for all columns; --收集表,索引,表字段信息
(1) 表的统计信息
select table_name, num_rows, blocks, empty_blocks
from user_tables
where table_name in ('T1', 'T2', 'T3', 'T4', 'T5','T6');
(2) 表中字段的统计信息
select table_name,
column_name,
num_distinct,
low_value,
high_value,
density
from user_tab_columns
where table_name in ('T1', 'T2', 'T3', 'T4','T5','T6');
<</B>其中会收集T2的表字段信息,T3是索引所在字段信息,T4表字段信息,T6表字段信息>
(3) 索引的统计信息
没有变化,说明在创建索引的时候就ORACLE就已经收集相关信息
[转] Oracle analyze 命令分析的更多相关文章
- Oracle Analyze 命令 详解
官网的链接如下: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_4005.htm#SQLRF01105 使用DBMS ...
- [转] Oracle analyze table 使用总结
转自:http://www.cnblogs.com/einyboy/archive/2012/08/09/2630321.html analyze table 一般可以指定分析: 表,所有字段,所有索 ...
- 对于Oracle analyze table的使用总结 . 对于Oracle analyze table的使用总结 .
对于Oracle analyze table的使用总结 . 对于Oracle analyze table的使用总结 . analyze table 一般可以指定分析: 表,所有字段,所有索引字段,所有 ...
- [ SHELL编程 ] 编程常用的ORACLE相关命令
本文主要描述shell编程中常用的Oracle相关命令. 1.sqlplus -L/-S参数 sqlplus -L user/password #-L参数表示用户只尝试登录一次, 而不是在出错时再次提 ...
- Oracle内存全面分析
Oracle内存全面分析 Oracle的内存配置与oracle性能息息相关.而且关于内存的错误(如4030.4031错误)都是十分令人头疼的问题.可以说,关于内存的配置,是最影响Oracle性能的配置 ...
- 使用analyze命令统计信息
① 搜集和删除索引.表和簇的统计信息② 验证表.索引和簇的结构③ 鉴定表和簇和行迁移和行链接针对analyze的搜集和删除统计信息功能而言Oracle推荐使用DBMS_STATS包来代替analyze ...
- ORACLE ANALYZE使用小结
ANALYZE的介绍 使用ANALYZE可以收集或删除对象的统计信息.验证对象的结构.标识表或cluster中的行迁移/行链接信息等.官方文档关于ANALYZE功能介绍如下: · ...
- PLSQL_性能优化系列16_Oracle Tuning Analyze优化分析
2014-12-23 Created By BaoXinjian
- oracle常用命令【转载】
oracle常用命令 一.Oracle数据库实例.用户.目录及session会话查看: 1.ORACLE SID查看设置 查看SID.用户名 $ env|grep SID .select * from ...
随机推荐
- Document types require more than xhtml1.0
这个东西只会在比较低版本的浏览器中会出现,比如IE7及以下会出这个错误. 错误的根源是html页面没有考虑浏览器兼容性问题. 在页面头部加入下面的内容即可解决标题中的问题 <!DOCTYPE h ...
- GridView使用自带分页功能时分页方式及样式PagerStyle
// 转向地址:http://www.bubuko.com/infodetail-412562.html GridView分页,使用自带分页功能,类似下面样式: 在aspx页面中,GridView上的 ...
- Fragment的陷阱(转)
以前做过的一个项目,Fragment嵌套高德地图,当再次进入Fragment的时候,会出现奇怪的现象.嵌套的地图会出现滑动不动的情况,起先还以为是高德的bug呢,经过一番研究,终确定这是一个坑. 先对 ...
- Hadoop的管理目录
HDFS文件结构 1.NameNode的文件结构,NameNode会创建VERSION.edits.fsimage.fstime文件目录.其中dfs.name.dir属性是一个目录列表,是每个目录的镜 ...
- 自制公众平台Web Api(微信)
最近一段时间感觉没什么东西可以分享给大家,又由于手上项目比较赶,不太更新博客了,今天趁着生病闲下来的时间分享一些项目中的东西给大家. 公众平台 提起公众平台当下最流行的莫过于腾讯的微信了,当然还有易信 ...
- html 定位问题
HTML精确定位:scrollLeft,scrollWidth,clientWidth,offsetWidth scrollHeight: 获取对象的滚动高度. scrollLeft:设置或获取位于对 ...
- CRM 2016 级联过滤
以下以省市为例: function preFilterLookup() { //要进行过滤的lookup按钮加入addPresearch事件 Xrm.Page.getControl("shi ...
- 70. Implement strStr() 与 KMP算法
Implement strStr() Implement strStr(). Returns a pointer to the first occurrence of needle in haysta ...
- 转:WIN7上搭建Windows Phone 8 开发环境——VMware Workstation下Win8 “无法安装Hyper-V, 某个虚拟机监控程序正在运行”问题解决的办法
转自:http://www.cnblogs.com/shaddock2013/p/3155024.html 最近在试着在Windows 7上搭建Windows Phone 8的开发调试环境,使用的是V ...
- study topics
永远不变的东西,原理 study roadmap: 1.user space: tizen power manager => suspend/resume or runtime? android ...