I want to create a SQL baseline for a very simple statement in Oracle 11g. But the created baseline is not even considered. In the resulting plan there is even no 'Note' section, that would say that it failed to use SQL plan baseline.
So I have the following statement:
select * from A.some_table where id = 1345;
I find the SQL_ID of this statement and then load the plan into a baseline:
DECLARE
cnt NUMBER;
BEGIN
cnt := sys.dbms_spm.load_plans_from_cursor_cache(sql_id=>'c81xtthmbvhfr');
END;
I confirm that the baseline was created using the following query (the plan is enabled and accepted):
SELECT b.* FROM dba_sql_plan_baselines b, v$sql s
WHERE s.sql_id='c81xtthmbvhfr' AND s.exact_matching_signature = b.signature;
Then I flush the shared pool and execute the statement again, but the resulting plan says nothing about sql plan baselines in the Note section. When I generated trace [SQL_Compiler.*]
trace, it had this: `SPM: current statement disallowed`
The parameter optimizer_use_sql_plan_baselines
is set to true. And also the database is in RAC environment. Need help to understand why the plan baselines are not considered
Thanks!