I got this error at alertlog on Oracle 18c Database.
Complete errors are:
There is an error in the Oracle alert log file!\n
ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_111029″
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at “SYS.DBMS_STATS”, line 49565
ORA-06512: at “SYS.DBMS_STATS_ADVISOR”, line 881
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 21631
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 23763
ORA-06512: at “SYS.DBMS_STATS”, line 49553
The first step is let us Check to see whether this advisory packages are exists in the database by the following script.
select name, ctime, how_created
from sys.wri$_adv_tasks
where owner_name = 'SYS'
and name in ('AUTO_STATS_ADVISOR_TASK','INDIVIDUAL_STATS_ADVISOR_TASK');
no rows selected
If the result is “no rows selected”, than then it means the advisory packages aren’t exist. We need to create it by following:
EXEC dbms_stats.init_package(); PL/SQL procedure successfully completed.
Now we can run same select sentences again. You will see output will be change and error will not appear again.

Yorum bırakın