Ad

DBMS Scheduler Error: ORA-27367: Program "Schema.PROG_programname" Associated With This Job Is Disabled

- 1 answer

I have created an oracle job using dbms scheduler.But the status gets failed in the execution. It gives the following error. 'ORA-27367: program "Schema.PROG_SIXMONTHPRIORITY" associated with this job is disabled' But I do not have disabled the job. 'program_action => 'SIXMONTHPRIORITY'' is a procedure that I have created in the schema. When I execute that procedure separately, it gets executed.

BEGIN
DBMS_SCHEDULER.CREATE_PROGRAM (
program_name      => 'PROG_SIXMONTHPRIORITY',
program_action     => 'SIXMONTHPRIORITY',
program_type      => 'STORED_PROCEDURE');
END;

BEGIN
DBMS_SCHEDULER.CREATE_SCHEDULE (
 schedule_name   => 'P_SCHEDULE_3',
 start_date    => SYSTIMESTAMP,
 repeat_interval  => 'FREQ= MINUTELY; INTERVAL=30; BYMONTHDAY=19; BYHOUR=13',
 end_date     => SYSTIMESTAMP + INTERVAL '1' day,
 comments     => 'Every 30 minutes');
END;

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
  job_name     => 'CAL_SIX_MON_PRIORITY_3',
  program_name   => 'PROG_SIXMONTHPRIORITY',
  schedule_name   => 'P_SCHEDULE_3');
END;

Can anyone identify the reason for this error?

Ad

Answer

The Scheduler objects that you created can also be separately enabled or disabled. Make sure to specify "enabled => true" when creating scheduler objects:

BEGIN
    DBMS_SCHEDULER.CREATE_PROGRAM (
        program_name      => 'PROG_SIXMONTHPRIORITY',
        program_action     => 'SIXMONTHPRIORITY',
        program_type      => 'STORED_PROCEDURE',
        enabled => true);
END;

BEGIN
    DBMS_SCHEDULER.CREATE_SCHEDULE (
        schedule_name   => 'P_SCHEDULE_3',
        start_date    => SYSTIMESTAMP,
        repeat_interval  => 'FREQ= MINUTELY; INTERVAL=30; BYMONTHDAY=19; BYHOUR=13',
        end_date     => SYSTIMESTAMP + INTERVAL '1' day,
        comments     => 'Every 30 minutes');
END;

BEGIN
    DBMS_SCHEDULER.CREATE_JOB (
        job_name     => 'CAL_SIX_MON_PRIORITY_3',
        program_name   => 'PROG_SIXMONTHPRIORITY',
        schedule_name   => 'P_SCHEDULE_3',
        enabled => true);
END;

For existing objects, you can set the attributes directly:

BEGIN
    DBMS_SCHEDULER.ENABLE ('PROG_SIXMONTHPRIORITY');
    DBMS_SCHEDULER.ENABLE ('CAL_SIX_MON_PRIORITY_3');
END;
/
Ad
source: stackoverflow.com
Ad