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);
)
oracle 分析语句
最新推荐文章于 2021-04-09 14:02:05 发布