35 force_match => FALSE /* TRUE:FORCE (match even when different literals in SQL). FALSE:EXACT (similar to CURSOR_SHARING) */ );
36 DBMS_LOB.FREETEMPORARY(sql_txt);
37 END;
38 /
PL/SQL procedure successfully completed.
zx@MYDB>WHENEVER SQLERROR CONTINUE
zx@MYDB>SET ECHO OFF;
SIGNATURE
---------------------
3589138201450662673
SIGNATUREF
---------------------
8068435081012723673
... manual custom SQL Profile has been created
COE_XFR_SQL_PROFILE_6chcc0pvvhqqm_3617692013 completed
e. 执行完成后再次查看目标SQL的执行计划
zx@MYDB>select /*+no_index(t1 idx_t1) */ * from t1 where n=1;
N
----------
1
从执行计划中可以看出已经走了INDEX RANGE SCAN,而且note部分提示SQL profile coe_6chcc0pvvhqqm_3617692013 used for this statement,说明执行sql时使用了该SQL Profile。
如果想在目标SQL的SQL文本发生变动时SQL Profile依然生效,则需要修改生成的脚本里的force_match=>true。