ORA-12012 ORA-20001 ORA-06512: at “SYS.DBMS_STATS”

Error in alert log crashing database:

ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_88″
ORA-20001: Statistics Advisor: Invalid Task Name For the current user <== Note it
ORA-06512: at “SYS.DBMS_STATS”, line 46861
ORA-06512: at “SYS.DBMS_STATS_ADVISOR”, line 734
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 19930
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 21934
ORA-06512: at “SYS.DBMS_STATS”, line 46851

Solution:  Run dbms_stats.init_package()  in the database to create the tasks correctly as it was not executed properly during database creation.

SQL> EXEC dbms_stats.init_package();

PL/SQL procedure successfully completed.

SQL> column name format A35
set linesize 120

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’);SQL> SQL> SQL> 2 3 4

NAME CTIME HOW_CREATED
———————————– ——— ——————————
AUTO_STATS_ADVISOR_TASK 03-APR-18 CMD
INDIVIDUAL_STATS_ADVISOR_TASK 03-APR-18 CMD

Nagulu Polagani

"We are all apprentices in a craft where no one ever becomes a master."