Oracle Scheduler(4)job呼叫program和schedule

zhenghaishu發表於2015-10-28
program決定做什麼;schedule決定何時做;job則起到觸發的作用:做。

BEGIN
dbms_scheduler.create_program (
  program_name => 'my_program',
  program_action => 'E:\mytest.bat',
  program_type => 'EXECUTABLE',
  enabled => TRUE );
END;
/

BEGIN
dbms_scheduler.create_schedule (
  schedule_name => 'my_schedule',
  start_date => sysdate,
  repeat_interval => 'FREQ=MINUTELY; INTERVAL=1');
END;
/
 
BEGIN
dbms_scheduler.create_job (
  job_name => 'my_job',
  program_name => 'my_program',
  schedule_name => 'my_schedule',
  enabled => TRUE);
END;
/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29485627/viewspace-1817492/,如需轉載,請註明出處,否則將追究法律責任。

相關文章