SQLT profile SQL "Glue" not how don't eliminate the inefficient Plan hash value?

I have a strange problem. I have used many times before SQLT not only assign a SQL profile for a specific query, but also for the force_match of other issues with different literal values. It has always worked in the past. I run the following script:

START coe_xfr_sql_profile.sql <sql_id> <plan_hash_value>

I take the generated script and modify the following (line #9) to force the game.

DBMS_SQLTUNE.IMPORT_SQL_PROFILE (
sql_text    => sql_txt,
profile     => h,
name        => 'some_name',
description => 'some description'||:signature||' '||:signaturef||'',
category    => 'DEFAULT',
validate    => TRUE,
replace     => TRUE,
force_match => TRUE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
DBMS_LOB.FREETEMPORARY(sql_txt);
END;
/

When I run the script, I can see the profile is assigned to the specified SQL_ID, but not for those with a different literal values (example: LIKE "< some_value >"). I know that we should use bind variables here and that will be recommended for the developer. The difference between the two plans, however, is huge (+ 30 minutes instead of milliseconds) and the impact on our production database is very noticeable when multiple users are doing the same. When I take a look at the different SQL_ID, they all use the exact same ineffective regime. Since I can't make the SQL profile on all of the SQL_ID, is there a way to eliminate the inefficient system of restraint? I used forced for several times and this is the first time, it didn't work. Help is greatly appreciated. Thank you.

Have you checked the FORCE_MATCH_SIGNATURE of the SQL statements in question in V$ SQL?

If they are not all the same, the FORCE_MATCH cannot help.

Why they may not have the same thing?

For example, if they use links AND literals.

E.g. literals only:

set serveroutput on
declare
l_sig NUMBER;
begin
l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 1',TRUE);
dbms_output.put_line(l_sig);
end;
/
anonymous block completed
109606082837927916

declare
l_sig NUMBER;
begin
l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 2',TRUE);
dbms_output.put_line(l_sig);
end;
/
anonymous block completed
109606082837927916

But if you use bind AND literals:

declare
l_sig NUMBER;
begin
l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 1 and col2 = :1',TRUE);
dbms_output.put_line(l_sig);
end;
/
anonymous block completed
16455499341945681140

declare
l_sig NUMBER;
begin
l_sig := dbms_sqltune.sqltext_to_signature('select * from t1 where col1 = 2 and col2 = :1',TRUE);
dbms_output.put_line(l_sig);
end;
/
anonymous block completed
13278767079226598822

Unfortunately...

Tags: Database

Similar Questions

Maybe you are looking for

  • iPhone 6 iOS 10 massive battery drain

    Use iOS 10 since beta. Around Beta 5 or 6 noticed my iPhone 6 suddenly started battery drains very quickly and also began the statement incorrect autonomy (jumping massive amounts of %). Continued on the public (10.0.1). version I know that it's a so

  • When I open a new tab, how can I get the new standard tab page?

    When I opened a new page, I get AVG Search to ensure that the new page. I want the new standard page that Firefox offers where I can organize my best sites on the new page. I don't want AVG, but I can't get rid of it.

  • Toshiba KIRA-102 with dust inside the screen

    Hello Big disapointement! It's my 4th Toshiba (first back in 1997... and still works!)My Satellite M30X with 10 years (ok) and my Tecra R840 with 3 years works 24 hours a day from the last August :-) The las one... a 102 Kira bought las November!Neve

  • I have a deskjet 1000 and bought the HP 61 cartridge.

    I have a deskjet 1000 and bought the HP 61 cartridge. The deskjet printer came with 122 HP cartridges.  I tried to install the HP 61 cartridge but the message is "incompatible cartridge".

  • Problem with installation of updates for Windows Vista.

    I have vista basic and my windows update tells me that she does not turn and I have to restart my computer.  The problem is not resolved.  In case there is no solution, I want to know if there is a way to download the updates manually because the aut