问题描述
嗨,汤姆,我们从11g开始引入了SPM,现在迁移到12c (在main. window期间,SPM会被卷化)
但是,我们的evolve程序停留在某些特定语句上,因此在4小时 (在主窗口期间) 后,SPM EVOLVE被中断-> 因此,整个基线都不会被进化!(我们正在通过一个高事务数据库约136K个基线!)
几个SRs没有帮助我们打开:-(
我们非常有信心 (因为我们已经监控了运行的进化会话severla时间),某些sql的进化 (解析) 需要很长的时间 (并创建长的操作被终止),其他人不能同时进化。
Alos我们能够 (根据12c SPM的新功能) 识别和隔离适当的sql,以使其完全不发展...
除非你有其他想法或建议!?
这是我们在DBA_ADVISOR_TASKS视图中看到的:
从DBA_ADVISOR_TASKS中选择 *,其中任务名称如 “% SYS_AUTO_SPM_EVOLVE_TASK %”;
系统57208系统自动SPM进化任务SPM进化顾问17.01.2016 08:21:18 2017年8月18日02:00:030 0 EXEC_84463 SPM进化717.08.2017 22:00:06 2017年8月18日02:00:03INTERRUPTED 0 ORA-13638: Der Benutzer hat den aktuellen Vorgang unterbrochen。自动假真11 4
这是我们为autom设置advisor参数。进化:
选择参数 _ 名称,参数 _ 值
来自dba_advisor_parameters
其中任务名称 = “系统自动spm进化任务”
和参数 _ 值!= 'UNUSED'
按参数 _ 名称排序;
ACCEPT_PLANS TRUE
无限过期
默认执行类型SPM进化
执行 _ 天 _ 到 _ 过期30
日志信息
模式综合
_ Spm _ 验证TRUE
目标 _ 对象1
时间限制2147483646
谢谢!
阿里雷扎
但是,我们的evolve程序停留在某些特定语句上,因此在4小时 (在主窗口期间) 后,SPM EVOLVE被中断-> 因此,整个基线都不会被进化!(我们正在通过一个高事务数据库约136K个基线!)
几个SRs没有帮助我们打开:-(
我们非常有信心 (因为我们已经监控了运行的进化会话severla时间),某些sql的进化 (解析) 需要很长的时间 (并创建长的操作被终止),其他人不能同时进化。
Alos我们能够 (根据12c SPM的新功能) 识别和隔离适当的sql,以使其完全不发展...
除非你有其他想法或建议!?
这是我们在DBA_ADVISOR_TASKS视图中看到的:
从DBA_ADVISOR_TASKS中选择 *,其中任务名称如 “% SYS_AUTO_SPM_EVOLVE_TASK %”;
系统57208系统自动SPM进化任务SPM进化顾问17.01.2016 08:21:18 2017年8月18日02:00:030 0 EXEC_84463 SPM进化717.08.2017 22:00:06 2017年8月18日02:00:03INTERRUPTED 0 ORA-13638: Der Benutzer hat den aktuellen Vorgang unterbrochen。自动假真11 4
这是我们为autom设置advisor参数。进化:
选择参数 _ 名称,参数 _ 值
来自dba_advisor_parameters
其中任务名称 = “系统自动spm进化任务”
和参数 _ 值!= 'UNUSED'
按参数 _ 名称排序;
ACCEPT_PLANS TRUE
无限过期
默认执行类型SPM进化
执行 _ 天 _ 到 _ 过期30
日志信息
模式综合
_ Spm _ 验证TRUE
目标 _ 对象1
时间限制2147483646
谢谢!
阿里雷扎
专家解答
嗨,阿里雷扎,
在维护窗口期间,夜间SPM evolve任务作为SQL优化任务的一部分运行。默认情况下,该任务仅需要1个小时即可完成,而SQL优化顾问首先要完成。
当SPM evolve任务开始时,它会使用以下标准编制未接受计划的有序列表,在每个维护窗口期间将对其进行检查:
最后验证
最后执行
成本
创作时间
Plans that are unaccepted and have a value of NULL for their 最后验证column go to the top of the list. Out of that group, plans are ordered based on the value in the 最后执行column, then on the 成本 of the plans and finally on 创作时间, with the oldest ones going first.
为了防止特定计划被添加到evolve任务列表中,您需要做两件事:
• Have a non-NULL value in the 最后验证column
·将计划标记为已接受
根据您认为所讨论的计划是好计划还是坏计划,将决定您应该采取什么方法来防止将计划添加到evolve任务列表中。
如果您不知道这是否是一个好计划,最安全的方法是使用DBMS_SPM.EXECUTE_EVOLVE_TASK函数手动运行该计划的evolve任务。通过手动运行任务,您将删除维护窗口时间限制,并且可以验证未接受的计划是否比现有计划更好。
Once the task completes the 最后验证column will be updated and therefore no longer NULL. If the plan is accepted after the evolve task it will never become a candidate for the task again.
If however, the plan is not accepted after the task completes, then the plan will not be considered for the nightly evolve task for at least 30 days and then only if it’s only then if the SQL statement is active (最后执行attribute has been updated).
If you know that the problematic plan really is a good plan that you want to have accepted, you can manually accept the plan without having to run the verification part of the evolve process by using the old DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE function, with the VERIFY parameter set to NO. This will instantly accepted the new plan and update the 最后验证column, which will remove the statement from the evolve task list forever.
如果你确定有问题的计划是一个你永远不想使用的糟糕计划,那么你可以采取两步方法:
1.如上所述,使用DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE函数手动接受计划而无需验证
2.然后立即通过使用ALTER_SQL_PLAN_BASELINE函数标记禁用的计划,如下所示
在维护窗口期间,夜间SPM evolve任务作为SQL优化任务的一部分运行。默认情况下,该任务仅需要1个小时即可完成,而SQL优化顾问首先要完成。
当SPM evolve任务开始时,它会使用以下标准编制未接受计划的有序列表,在每个维护窗口期间将对其进行检查:
最后验证
最后执行
成本
创作时间
Plans that are unaccepted and have a value of NULL for their 最后验证column go to the top of the list. Out of that group, plans are ordered based on the value in the 最后执行column, then on the 成本 of the plans and finally on 创作时间, with the oldest ones going first.
为了防止特定计划被添加到evolve任务列表中,您需要做两件事:
• Have a non-NULL value in the 最后验证column
·将计划标记为已接受
根据您认为所讨论的计划是好计划还是坏计划,将决定您应该采取什么方法来防止将计划添加到evolve任务列表中。
如果您不知道这是否是一个好计划,最安全的方法是使用DBMS_SPM.EXECUTE_EVOLVE_TASK函数手动运行该计划的evolve任务。通过手动运行任务,您将删除维护窗口时间限制,并且可以验证未接受的计划是否比现有计划更好。
Once the task completes the 最后验证column will be updated and therefore no longer NULL. If the plan is accepted after the evolve task it will never become a candidate for the task again.
If however, the plan is not accepted after the task completes, then the plan will not be considered for the nightly evolve task for at least 30 days and then only if it’s only then if the SQL statement is active (最后执行attribute has been updated).
If you know that the problematic plan really is a good plan that you want to have accepted, you can manually accept the plan without having to run the verification part of the evolve process by using the old DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE function, with the VERIFY parameter set to NO. This will instantly accepted the new plan and update the 最后验证column, which will remove the statement from the evolve task list forever.
variable evol_out clob execute :evol_out := dbms_spm.evolve_sql_plan_baseline(sql_handle=>'SYS_SQL_edcedb30afeb8caa', plan_name=>'SQL_PLAN_fvmqv62ryr35ac47b6be0' verify=>’NO’); select :evol_out from dual;复制
如果你确定有问题的计划是一个你永远不想使用的糟糕计划,那么你可以采取两步方法:
1.如上所述,使用DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE函数手动接受计划而无需验证
2.然后立即通过使用ALTER_SQL_PLAN_BASELINE函数标记禁用的计划,如下所示
variable cnt number exec :cnt := dbms_spm.alter_sql_plan_baseline( - sql_handle => 'SQL_293ebc02a81d5606', - plan_name => 'SQL_PLAN_2kgpw0an1uph654bc8843', - attribute_name => 'ENABLED', - attribute_value => 'NO');复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
504次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
484次阅读
2025-04-15 17:24:06
墨天轮个人数说知识点合集
JiekeXu
405次阅读
2025-04-01 15:56:03
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
398次阅读
2025-04-08 09:12:48
Oracle SQL 执行计划分析与优化指南
Digital Observer
374次阅读
2025-04-01 11:08:44
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
360次阅读
2025-04-18 14:18:38
Oracle 19c RAC更换IP实战,运维必看!
szrsu
343次阅读
2025-04-08 23:57:08
oracle定时任务常用攻略
virvle
316次阅读
2025-03-25 16:05:19
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
315次阅读
2025-04-15 14:48:05
风口浪尖!诚通证券扩容采购Oracle 793万...
Roger的数据库专栏
311次阅读
2025-03-24 09:42:53