Error:
Errors in file /u01/app/oracle/diag/rdbms/bpay/bpay/trace/bpay_j000_24499.trc:
ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_586″
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at “SYS.DBMS_STATS”, line 47207
ORA-06512: at “SYS.DBMS_STATS_ADVISOR”, line 882
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 20059
ORA-06512: at “SYS.DBMS_STATS_INTERNAL”, line 22201
ORA-06512: at “SYS.DBMS_STATS”, line 47197
Cause:
It’s a known bug, the advisory packages are missing in the database.
Solution:
Check to see whether this advisory packages are exists in the database by the following script.
SQL>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 no rows selected returns then the advisory packages aren’t exist, create the packages with below command.
SQL> EXEC dbms_stats.init_package();PL/SQL procedure successfully completed.
SQL> 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’); 2 3 4NAME
——————————————————————————–
CTIME HOW_CREATED
——— ——————————
AUTO_STATS_ADVISOR_TASK
01-MAR-20 CMDINDIVIDUAL_STATS_ADVISOR_TASK
01-MAR-20 CMD