Tag Archives: ORA-12012 error

[Solved] ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_363″

surroundings:

OS: Hundreds 7

DB: 18.3.0.0

 

error:
Errors in file /u01/oracle/app/diag/rdbms/slnngk/slnngk1/trace/slnngk1_j000_949.trc:
ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_363″
ORA-20001: Statistics Advisor: Invalid task name for the current user
ORA-06512: at “SYS.DBMS_STATS”, line 49538
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 49526
2021-07-19T23:56:32.032323-04:00

Solution:
Log in and execute on one of the nodes:
sqlplus /nolog
connect / as sysdba

SQL> show pdbs

CON_ID CON_NAME OPEN MODE RESTRICTED
———- —————————— ———- ———-
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO

SQL> EXEC dbms_stats.init_package();

PL/SQL procedure successfully completed.

SQL> column name format A35
SQL> set linesize 120
SQL> select name, ctime, how_created
2 from sys.wri$_adv_tasks
3 where owner_name = ‘SYS’
4 and name in (‘AUTO_STATS_ADVISOR_TASK’,’INDIVIDUAL_STATS_ADVISOR_TASK’);

NAME CTIME HOW_CREATED
———————————– ——— ——————————
AUTO_STATS_ADVISOR_TASK 20-JUL-21 CMD
INDIVIDUAL_STATS_ADVISOR_TASK 20-JUL-21 CMD