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;
/
sam_2012Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
johnsoneSenior Oracle DBACommented:
Try checking USER_SCHEDULER_JOB_RUN_DETAILS.  Any error messages should be in there.
0
sam_2012Author Commented:
awesome.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Databases

From novice to tech pro — start learning today.