暂无图片
Oracle19c,为何不断有自动捕获的baseline
我来答
分享
流星
2022-11-20
Oracle19c,为何不断有自动捕获的baseline

版本Oracle 19.3.0.0.0,参数optimizer_capture_sql_plan_baseline为false,baseline的创建时间没有规律性,在维护窗口的其他时间也有创建的

我来答
添加附件
收藏
分享
问题补充
2条回答
默认
最新
哇哈哈

1、以前开过optimizer_capture_sql_plan_baseline=true?

2、参数解释

OPTIMIZER_CAPTURE_SQL_PLAN_BASELINES=false

For any repeatable SQL statement that does not already exist in the plan history, the database does not automatically create an initial SQL plan baseline for the statement.

我理解optimizer_capture_sql_plan_baseline=false,只是控制以前没有baseline的sql不再生成baseline,以前有baseline的sql会根据统计信息变化等原因,继续生成新的baseline

3、可以删除某条SQL的现有baseline,以后一不会生成新的了

DECLARE
v_dropped_plans number;
BEGIN
v_dropped_plans := DBMS_SPM.DROP_SQL_PLAN_BASELINE (
sql_handle => 'SQL_1f842bf5e900a2f2'
);
DBMS_OUTPUT.PUT_LINE('dropped ' || v_dropped_plans || ' plans');
END;
/
复制
暂无图片 评论
暂无图片 有用 1
打赏 0
刘贵宾
2022-11-21
2022-11-21
流星
题主
2022-11-21
关键是这个参数OPTIMIZER_USE_SQL_PLAN_BASELINES 默认为true。11g文档中有The best-cost plan found by the optimizer that does not match any plans in the plan history for the SQL statement represents a new plan. The database adds this plan as a nonaccepted plan to the plan history.在19c文档中有For any SQL statement that has an existing SQL plan baseline, the database automatically adds new plans to the SQL plan baseline as unaccepted plans.
展开全部评论(1条)
流星


暂无图片 评论
暂无图片 有用 0
打赏 0
回答交流
Markdown


请输入正文
提交