`
hotjava
  • 浏览: 179069 次
  • 性别: Icon_minigender_1
  • 来自: 天津
社区版块
存档分类
最新评论

表分析语句

 
阅读更多

Exec dbms_stats.gather_schema_stats(ownname=>'用户名称',estimate_percent=>100,cascade=> TRUE, degree =>12);


    含义解释 ownname:填写需要分析的用户(该用户下所有表都将被分析)
              estimate_percent:分析抽样的力度
              cascade:是否对索引进行分析
              degree:并行处理的cpu数量

对单个表做分析推荐使用 analyze table 表名 compute statistics;(将会把表下的索引一起分析) 对单个索引进行分析推荐使用 analyze index 索引名 compute statistics;



当然对单个表或者索引的分析也可以采用

        dbms_stats.gather_index_stats
dbms_stats.gather_table_stats
(exec dbms_stats.gather_table_stats(ownname=>'hbsps',tabname=>'fail_reason',estimate_percent=>100,cascade=> TRUE);
)


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics