• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 62
  • Last Modified:

Oracle database Scheduler

Below is the code I have run to schedule the job in oracle using scheduler in oracle.  I want to run the procedure every 12 hours. But the job does not run automatically , I need to run it manually. Any help is really appreciated.


BEGIN
  -- Job defined entirely by the CREATE JOB procedure.
  DBMS_SCHEDULER.create_job (
    job_name        => 'Load_OMR_data',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN P_LOAD_INVENTORY_DATA( ''' || 'today' || ''') END;',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'freq=HOURLY;Interval=12',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'Job to load inventory data for host database instance');
END;
/
0
sam_2012
Asked:
sam_2012
2 Solutions
 
sdstuberCommented:
It probably is running, but failing because you are missing a semicolon in your "job_action" parameter

Try creating it like this instead.  Note I use the q' syntax, makes it easier to verify the contents are correct

BEGIN
    DBMS_SCHEDULER.create_job(job_name          => 'Load_OMR_data',
                              job_type          => 'PLSQL_BLOCK',
                              job_action        => q'[BEGIN P_LOAD_INVENTORY_DATA('today'); END;]',
                              start_date        => SYSTIMESTAMP,
                              repeat_interval   => 'freq=HOURLY;Interval=12',
                              end_date          => NULL,
                              enabled           => TRUE,
                              comments          => 'Job to load inventory data for host database instance');
END;

Open in new window

0
 
johnsoneSenior Oracle DBACommented:
Try checking USER_SCHEDULER_JOB_RUN_DETAILS.  Any error messages should be in there.
0
 
sam_2012Author Commented:
awesome.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Improve Your Query Performance Tuning

In this FREE six-day email course, you'll learn from Janis Griffin, Database Performance Evangelist. She'll teach 12 steps that you can use to optimize your queries as much as possible and see measurable results in your work. Get started today!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now