转自: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 命令分析的更多相关文章

  1. Oracle Analyze 命令 详解

    官网的链接如下: http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_4005.htm#SQLRF01105 使用DBMS ...

  2. [转] Oracle analyze table 使用总结

    转自:http://www.cnblogs.com/einyboy/archive/2012/08/09/2630321.html analyze table 一般可以指定分析: 表,所有字段,所有索 ...

  3. 对于Oracle analyze table的使用总结 . 对于Oracle analyze table的使用总结 .

    对于Oracle analyze table的使用总结 . 对于Oracle analyze table的使用总结 . analyze table 一般可以指定分析: 表,所有字段,所有索引字段,所有 ...

  4. [ SHELL编程 ] 编程常用的ORACLE相关命令

    本文主要描述shell编程中常用的Oracle相关命令. 1.sqlplus -L/-S参数 sqlplus -L user/password #-L参数表示用户只尝试登录一次, 而不是在出错时再次提 ...

  5. Oracle内存全面分析

    Oracle内存全面分析 Oracle的内存配置与oracle性能息息相关.而且关于内存的错误(如4030.4031错误)都是十分令人头疼的问题.可以说,关于内存的配置,是最影响Oracle性能的配置 ...

  6. 使用analyze命令统计信息

    ① 搜集和删除索引.表和簇的统计信息② 验证表.索引和簇的结构③ 鉴定表和簇和行迁移和行链接针对analyze的搜集和删除统计信息功能而言Oracle推荐使用DBMS_STATS包来代替analyze ...

  7. ORACLE ANALYZE使用小结

      ANALYZE的介绍     使用ANALYZE可以收集或删除对象的统计信息.验证对象的结构.标识表或cluster中的行迁移/行链接信息等.官方文档关于ANALYZE功能介绍如下: ·      ...

  8. PLSQL_性能优化系列16_Oracle Tuning Analyze优化分析

    2014-12-23 Created By BaoXinjian

  9. oracle常用命令【转载】

    oracle常用命令 一.Oracle数据库实例.用户.目录及session会话查看: 1.ORACLE SID查看设置 查看SID.用户名 $ env|grep SID .select * from ...

随机推荐

  1. Python numpy函数hstack() vstack() stack() dstack() vsplit() concatenate()

    感觉numpy.hstack()和numpy.column_stack()函数略有相似,numpy.vstack()与numpy.row_stack()函数也是挺像的. stackoverflow上也 ...

  2. Nim游戏变种——取纽扣游戏

    (2017腾讯实习生校招笔试题)Calvin和David正在玩取纽扣游戏,桌上一共有16个纽扣,两人轮流来取纽扣,每人每次可以选择取1个或3个或6个(不允许不取),谁取完最后的纽扣谁赢.Cavin和D ...

  3. IE6与 javascript:void(0)

    遇到过几次这种问题,现在总结一下. 代码: <a onclick="window.location.href='http://www.google.com'" href=&q ...

  4. Correlation Filter in Visual Tracking系列二:Fast Visual Tracking via Dense Spatio-Temporal Context Learning 论文笔记

    原文再续,书接一上回.话说上一次我们讲到了Correlation Filter类 tracker的老祖宗MOSSE,那么接下来就让我们看看如何对其进一步地优化改良.这次要谈的论文是我们国内Zhang ...

  5. 四、Spring——Spring MVC

    Spring MVC 1.Spring MVC概述 Spring MVC框架围绕DispatcherServlet这个核心展开,DispatcherServlet负责截获请求并将其分配给响应的处理器处 ...

  6. MYSQL C API : struct MYSQL_STMT 结构的组合使用

    #include <iostream> #include <string> #include <string.h> #include <assert.h> ...

  7. requirejs笔记

    1.RequireJS是一个工具库,主要用于客户端的模块管理.它可以让客户端的代码分成一个个模块.实现异步或动态加载,从而提高代码的性能和可维护性.它的模块管理遵循AMD规范(Asynchronous ...

  8. LeetCode Implement pow(x, n).

    这个题目我也没有思路,同学们可以查看这个http://www.cnblogs.com/NickyYe/p/4442867.html 下面是我改进后的代码 第一种方法: class Solution { ...

  9. spring mvc定时任务的简单使用

    版权声明:本文为楼主原创文章,未经楼主允许不得转载,如要转载请注明来源. 说起定时任务,开发的小伙伴们肯定不陌生了.有些事总是需要计算机去完成的,而不是傻傻的靠我们自己去.可是好多人对定时器总感觉很陌 ...

  10. node socket.io web

    soket.io & web http://socket.io/get-started/chat/ 新建一個文件夾 soketWeb ; 在sokertWeb 文件夾內新建一個 package ...