dbms_sqltune using AWR data

Today I wanted to use dbms_sqltune on a SQL statement that was run on Friday, but had not been executed since then. dbms_sqltune by default will assume the statement is still in the shared pool. If it is not, you must use one of the overloaded procedures for create_tuning_task.

See below…

variable l varchar2(4000)
begin
  :l := dbms_sqltune.create_tuning_task(begin_snap => 47631, end_snap => 47637, 
                                        sql_id=>'gjnx2b8t0nz90',task_name=>'wcrs');
end;
/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.