Oracle JOB 建立例項

tolywang發表於2010-08-08

DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
  ( job       => X
   ,what      => 'APPS.TEST_WQ;'
   ,next_date => to_date('10/08/2012 11:00:00','dd/mm/yyyy hh24:mi:ss')
   ,interval  => 'null'
   ,no_parse  => FALSE
  );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
COMMIT;
END;
/
 
 
DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
  ( job       => X
   ,what      => 'declare errbuf varchar2(4000); retcode varchar2(4000); begin WF_BES_CLEANUP.CLEANUP_SUBSCRIBERS(errbuf, retcode); end;'
   ,next_date => to_date('10/08/2012 11:58:22','dd/mm/yyyy hh24:mi:ss')
   ,interval  => 'sysdate + 4/24'
   ,no_parse  => FALSE
  );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
COMMIT;
END;
/
 

DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
  ( job       => X
   ,what      => 'FND_SVC_COMPONENT.EXECUTE_REQUEST (p_component_request_id => 10000);'
   ,next_date => to_date('01/01/4000 00:00:00','dd/mm/yyyy hh24:mi:ss')
   ,interval  => 'SYSDATE + (1440/(24*60))'
   ,no_parse  => FALSE
  );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
  SYS.DBMS_JOB.BROKEN
   (job    => X,
    broken => TRUE);
COMMIT;
END;
/

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

相關文章