Oracle快速收集全库统计信息

栏目: 数据库 · Oracle · 发布时间: 6年前

内容简介:环境:Oracle 11.2.0.4采用并行的方式,快速收集全库统计信息,多用于跨版本升级之后,对全库的统计信息重新进行快速收集:--开启计时

环境:Oracle 11.2.0.4

采用并行的方式,快速收集全库统计信息,多用于跨版本升级之后,对全库的统计信息重新进行快速收集:

--开启计时

set timing on

--设置并行收集

exec dbms_stats.set_global_prefs('CONCURRENT','TRUE');

--开始收集全库统计信息

begin

dbms_stats.gather_database_stats(

ESTIMATE_PERCENT=>DBMS_STATS.AUTO_SAMPLE_SIZE, method_opt => 'for all indexed columns', cascade=>true, degree=>120);

end;

/

--关闭并行收集

exec dbms_stats.set_global_prefs('CONCURRENT','FALSE');

注意degree的值并不是设置越高就越快,同时要根据实际CPU具体情况来设置。

本文来自同事的经验分享,这里主要用到dbms_stats包的set_global_prefs和gather_database_stats过程。详见官档描述:

https://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

本文永久更新链接地址: https://www.linuxidc.com/Linux/2018-12/155797.htm


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

An Introduction to Probability Theory and Its Applications

An Introduction to Probability Theory and Its Applications

William Feller / Wiley / 1991-1-1 / USD 120.00

Major changes in this edition include the substitution of probabilistic arguments for combinatorial artifices, and the addition of new sections on branching processes, Markov chains, and the De Moivre......一起来看看 《An Introduction to Probability Theory and Its Applications》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

html转js在线工具
html转js在线工具

html转js在线工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具