Fwd: Automatic SQL Tuning SYS_AUTO_SQL_TUNING_TASK Fails With ORA-13605 or ORA-13602

Problem Description:
----------------------------
One of the following errors occur in the alert.log and relevant trace file for the job running SQL Tuning Advisor
ORA-12012: error on auto execute of job "SYS"."ORA$AT_SQ_SQL_SW_12402"
ORA-13605: The specified task or object SYS_AUTO_SQL_TUNING_TASK does not exist for the current user.
ORA-06512: at "SYS.PRVT_ADVISOR", line 2735
ORA-06512: at "SYS.DBMS_ADVISOR", line 241
ORA-06512: at "SYS.DBMS_SQLTUNE", line 821
ORA-06512: at line 4 
  
OR
ORA-12012: error on auto execute of job "SYS"."ORA$AT_SQ_SQL_SW_4643"
ORA-13602: The specified parameter TARGET_OBJECTS is not valid for task or object 1.
ORA-06512: at "SYS.PRVT_ADVISOR", line 2715
ORA-06512: at "SYS.DBMS_ADVISOR", line 241
ORA-06512: at "SYS.DBMS_SQLTUNE", line 821
ORA-06512: at line 4


Root Cause:
----------------

This may be a result  of missing or corrupted SQL tuning task

You can verify this as follows:

1) Verify the information for task executions:

SQL> select owner, task_name, execution_start, execution_end from dba_advisor_executions where task_name like '%SYS_AUTO_SQL%';

no rows selected


2) Confirm that the execution of  SQL Tuning advisor fails when executed manually

SQL> exec dbms_sqltune.execute_tuning_task('SYS_AUTO_SQL_TUNING_TASK');

ORA-12012: error on auto execute of job "SYS"."ORA$AT_SQ_SQL_SW_12402"
ORA-13605: The specified task or object SYS_AUTO_SQL_TUNING_TASK does not exist for the current user.
ORA-06512: at "SYS.PRVT_ADVISOR", line 2735
ORA-06512: at "SYS.DBMS_ADVISOR", line 241
ORA-06512: at "SYS.DBMS_SQLTUNE", line 821
ORA-06512: at line 4



Solution:
-----------

To resolve this issue, recreate the automatic SQL Tuning task using the standard creation script:

Connect / as sysdba
$ORACLE_HOME/rdbms/admin/execsqlt.sql

Or

Re-run the tuning advisor on the problematic SQL and accept the recommended tuning task. 





Comments

  1. Great.. It helped but my issues was little different .. And found this link usefull as well

    http://www.moreajays.com/2020/07/ora-13605-specified-task-or-object-does.html

    ReplyDelete

Post a Comment