是否可以从自动 sql 调整顾问作业中跳过特定的 SQL 语句

Is it possible to skip the particular SQL statement from auto sql tuning advisor job

我遇到了自动 sql 调整顾问的 ORA:7445 问题。 Auto sql 调整顾问一直失败

ORA:7445

同时它会尝试调整特定的 SQL。

有什么方法可以从自动 sql 优化顾问作业中跳过这个 sql 语句吗?

避免自动 SQL Tuning Advisor 的最简单方法可能是将查询转换为程序不支持的形式。

根据the "Automatic SQL Tuning" chapter of the "Database Performance Tuning Guide"

The database ignores recursive SQL and statements that have been tuned recently (in the last month), parallel queries, DML, DDL, and SQL statements with performance problems caused by concurrency issues.

如果查询 select * from dba_objects 导致问题,请尝试 re-writing 如下所示:

select * from dba_objects
union all
--This query block only exists to avoid the Automatic SQL Tuning Advisor.
select /*+ parallel(dba_objects 2) */ * from dba_objects 
where 1=0;

它现在是 "parallel query",虽然它不会真正 运行 并行,因为 1=0。我还没有测试过这个,我想你会很难测试,因为你需要刷新现有的 AWR 数据以防止错误。

这是我通常禁用自动 SQL 优化顾问的原因之一。我喜欢它的想法,但实际上我从未见过调优顾问提供有用的信息。它为我所做的一切就是生成警报。


理论中,包DBMS_AUTO_SQLTUNE包含参数BASIC_FILTEROBJECT_FILTERPLAN_FILTER。我认为其中之一可能有用,但我认为它们尚未实施。我在 Google 或 My Oracle Support 上找不到对它们的任何引用。当我为值输入随机文本时,没有错误。


理想情况下,我们会查找每个 ORA-00600 和 ORA-07445 错误,创建一个 SR,并修复底层问题。但是谁有时间呢?当你遇到数据库"bug",最好的解决办法通常是尽快避开它。