Oracle 参数 OPTIMIZER_DYNAMIC_SAMPLING 官方解释,作用,如何配置最优化建议

本站中文解释

OPTIMIZER_DYNAMIC_SAMPLING:动态采样参数,允许Oracle优化运行时动态采样数据,来构建准确的执行计划。默认为2,当值为1时表示Oracle使用最少采样来预测最佳执行计划,值为11时表示Oracle使用最多采样来预测最佳执行计划。可以通过提高此参数的值来改善查询的执行效果,例如改变此参数的值为11时,Oracle会对查询过程中的每一步采样更多的数据,从而生成更好的执行计划。

正确设置:
1. 通过profiler分析当前系统的查询语句,及其工作负荷,确定是否有必要改变此参数的值。
2. 根据执行计划的比较,及系统的性能,确定当前查询系统最有效的采样值大小,更改此参数的值;
3. 若发生此参数影响性能,慎重更改该参数。

官方英文解释

OPTIMIZER_DYNAMIC_SAMPLING controls both when the database gathers dynamic statistics, and the size of the sample that the optimizer uses to gather the statistics.

Property Description

Parameter type

Integer

Default value

If OPTIMIZER_FEATURES_ENABLE is set to 10.0.0 or higher, then 2

If OPTIMIZER_FEATURES_ENABLE is set to 9.2.0, then 1

If OPTIMIZER_FEATURES_ENABLE is set to 9.0.1 or lower, then 0

Modifiable

ALTER SESSION, ALTER SYSTEM

Modifiable in a PDB

Yes

Range of values

0 to 11

Basic

No

Note:

Dynamic statistics were called dynamic sampling in releases earlier than Oracle Database 12c Release 1 (12.1).

If the value of OPTIMIZER_DYNAMIC_SAMPLING is set to 11, the OPTIMIZER_FEATURES_ENABLE setting has no effect on the OPTIMIZER_DYNAMIC_SAMPLING setting.

See Also:

Oracle Database SQL Tuning
Guide
for detailed information about the values (0 – 11) that can be set for the OPTIMIZER_DYNAMIC_SAMPLING parameter.


数据运维技术 » Oracle 参数 OPTIMIZER_DYNAMIC_SAMPLING 官方解释,作用,如何配置最优化建议