当前位置:网站首页>Oracle collects statistics

Oracle collects statistics

2022-06-11 02:10:00 Drunken Xiaobai

show parameter cpu
begin
dbms_stats.gather_database_stats(
estimate_percent=>dbms_stats.auto_sample_size,
method_opt=>'for all columns size AUTO',
degree=>32,
cascade=>true,
no_invalidate=>false
);
end;
/

estimate_percent: Percentage of sampled rows , Value range [0.000001,100],null For all analysis , No sampling . Constant :DBMS_STATS.AUTO_SAMPLE_SIZE Is the default value , from oracle Determine the best sampling value .

cascade: Whether to collect information about the index , The default is FALSE.

no_invalidate:true: Indicates no cursor invalidation action , The original shared cursor Keep it as it is ;false: Denotes all... That relate the statistic object cursor All the failure ;auto_invalidate:Oracle Their own decisions shared cursor Failure action .

SYS.DBMS_STATS.gather_database_stats

 Insert picture description here
Parallel collection is not recommended , This mechanism will cause too many active sessions in the database , And cause severe load pressure on the database . In addition, attention shall be paid during collection dgree The value of the parameter .

exec dbms_stats.set_global_prefs('CONCURRENT','FALSE');
原网站

版权声明
本文为[Drunken Xiaobai]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110100526097.html

随机推荐