Tag Archives: dbms scheduler error

ORA-12012: error on auto execute of job in Oracle

ORA-12012: error on auto execute of job 55536

In the alert log, we see an error. We checked the job number causing it. If it’s unnecessary, drop or disable it using the dbms_scheduler procedure.

For checking the job status, last run time, and owner, inform the application team if it is an application job.

select
d.job_name,
d.job_action,d.NEXT_RUN_DATE,d.OWNER
from
dba_scheduler_jobs d,
sys.scheduler$_job s
where
d.job_action = s.program_action
and
s.obj# = 55536

If error related to Auto Gather stats jobs:
ORA-12012: error on auto execute of job "SYS"."ORA$AT_OS_OPT_SY_nn"

Error: ORA-12012: error on auto execute of job “SYS”.”ORA$AT_OS_OPT_SY_”

Solution
1. Run this query to check the advisory package:

col name for a30
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

2. If no row is found, initialize the package with these commands.

EXEC dbms_stats.init_package();

3. Verify the package create. It will fixed the issue.

col name for a30
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');

NAME CTIME HOW_CREATED
------------------------------ --------- --------------
AUTO_STATS_ADVISOR_TASK 05-DEC-18 CMD
INDIVIDUAL_STATS_ADVISOR_TASK 05-DEC-18 CMD