Link to home
Start Free TrialLog in
Avatar of codemonkey2480
codemonkey2480

asked on

Scheduling an Oracle Stored Procedure

I have a SP called spTest under Employee Schema. How do I schedule this SP to run 6 Am every day? I would like to use the DBMS_SCHEDULER than the old DBMS_JOB. How would I do that? Please help.
SOLUTION
Avatar of niaz
niaz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You need something like this.....

begin
  dbms_scheduler.create_job(
      job_name => 'TEST_SCHEDULE'
     ,job_type => 'PLSQL_BLOCK'
     ,job_action => 'begin employees.spTest end; '
     ,start_date => '08-Mar-2011 06:00 AM'
     ,repeat_interval => 'FREQ=DAILY'
     ,enabled => TRUE
     ,comments => 'Testing the schedulee.');
end;
/

Also, this link will help you....

http://www.oradev.com/dbms_scheduler.jsp

I hope this helps you to start with...
Avatar of codemonkey2480
codemonkey2480

ASKER

Thanks for the links.
Do I need to ENABLE it then add it to the Scheduler Queue for it to work?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial