I'm attempting to create a job using DBMS_SCHEDULER in an Oracle 11g DB but having some trouble setting the job class attribute. I have already looked in the SYS schema and there is a job class named "SCHED$_LOG_ON_ERRORS_CLASS" that only outputs to the log if a job fails, which is what I want instead of having it log every time the job succeeds. Here is the script I am using to create the job:
BEGIN
DBMS_SCHEDULER.CREATE_JOB(
job_name => 'DIRXML.CHECK_EVENTLOG',
job_type => 'STORED_PROCEDURE',
job_action => 'DIRXML.P_Check_Eventlog',
job_class => 'DIRXML.SCHED$_LOG_ON_ERRORS_CLASS',
repeat_interval => 'FREQ=SECONDLY;INTERVAL=30',
enabled => TRUE
);
END;
/
The script will execute without errors if I remove the job_class attribute but when I add it I get the following error:
ORA-27476: "SYS.SCHED$_LOG_ON_ERRORS_CLASS" does not exist ORA-06512: at "SYS.DBMS_ISCHED", line 124 ORA-06512: at "SYS.DBMS_SCHEDULER", line 271 ORA-06512: at line 2
The only thing I could think of is that permissions aren't set up correctly for my user?