Friday, August 4, 2017

In Oracle 12c Sql tuning advisor is not running even though its enabled

Faced a strange issue in oracle 12c. In automated maintenance task, sql tuning advisor was enabled. However, it was still not running. Validated  dba_autotask_operation, that  "sql tuning advisor" is enabled. However, view -dba_scheuler_job_run_details and dba_autotask_task showed that it was NOT running. 

This is a  bug in 12c.  


As per metalink note, either we have to apply a patch"20540751" or as a workaround, run @?/rdbms/admin/execsqlt.sql to create the scheduler program "'AUTO_SQL_TUNING_PROG" that was dropped. This program should then show in in dba_scheduler_programs.


References:
Automatic SQL Tuning Task Not Executing after upgrading to 12.1.0.2 (Doc ID 2171154.1)