Oracle Performance: How to Create Sql Profile for LITERALS
Create Sql Profile for Use With Literals
One interesting facet of sql profiles, in contrast to stored outlines, is that a profile can work even if different literals are used. Of course, this is where a stored outline falls down.
Create Sql Profile
This is really simple to do. Prepare to create a sql profile, as usual. But then, the argument, Force_Match should be used to enable this feature, as shown here:
execute dbms_sqltune.accept_sql_profile(task_name => 'chris1', -
replace => TRUE, force_match => TRUE);
For example, suppose your application doesn't use binds, but they have some poorly running sql. Just create a sql profile to lock in the right plan, but be sure to specify Force_Match, as shown above.
I have confirmed that the execution plan is indeed preserved!