SQL Tuning Task Creation ORA-13780: SQL statement does not exist.

SQL Tuning Task Creation ORA-13780: SQL statement does not exist.
=================================================


example:-

declare
 l_sql_tune_task_id  varchar2(100);
begin
 l_sql_tune_task_id := dbms_sqltune.create_tuning_task (
        sql_id      => 'your sql_id',
        scope       => dbms_sqltune.scope_comprehensive,
        time_limit  => 10800,
        task_name   => 'tuning task name',
        description => 'tuning task description');
 dbms_output.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
end;
/

declare
*
ERROR at line 1:
ORA-13780: SQL statement does not exist.
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.PRVT_SQLADV_INFRA", line 125
ORA-06512: at "SYS.DBMS_SQLTUNE", line 655

solution :----

 SELECT SNAP_ID FROM DBA_HIST_SQLSTAT
WHERE SQL_ID='sql_id'
ORDER BY SNAP_ID;


===========now create task============

declare
 l_sql_tune_task_id varchar2(100);
begin
 l_sql_tune_task_id := dbms_sqltune.create_tuning_task (
  begin_snap => 12345, 
  end_snap => 12350,
  sql_id => 'your sql_id',
  scope => dbms_sqltune.scope_comprehensive,
  time_limit => 10800,
  task_name => 'tuning task_name',
  description => 'tuning task description');
 dbms_output.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
end;
/






===============hope it helps you================

Comments

Post a Comment

Popular posts from this blog

Shareplex some commands

ORA-1092 : opitsk aborting process