Thursday 30 August 2012

Create SQL Profile

Sometimes we faced SQL plan changed issue.Using sqlt we can confirm whether plan of any sql has changed or not.

If plan is changed and we have best plan then we can set sql profile.

How to create SQL profile
Download the sqlt from metalink and Install it.
Once you generate the sqlt of any sqlid and confirmed the plan has changed then go to sqlt directory.

cd sqlt/utl
conn / as sysdba

SQL> START coe_xfr_sql_profile.sql 1jfdhkb18cg4c 3818097359;

1jfdhkb18cg4c --> SQL ID
3818097359--> BEST SQL hash value from sqlt report

This will generate a script to create the sql profile. Use it to create the profile.