1. 設定初始化參數 job_queue_processes : oracle 允許執行的最大任務數量 specifies the maximum number of processes that can be created for the execution of jobs. It specifies the number of job queue processes per instance (J000, ... J999). 最大值為 1000 sql> alter system set job_queue_processes=n; (n>0) 2. 查詢背景執行程序 sql> select name, description from v$bgprocess 3. 建立function or Stored Procedure 4. 執行程序 declare jobno number; begin dbms_job.submit(jobno, 'sp_test_alex;', sysdate, 'sysdate+1/1440'); dbms_output.put_line(jobno); commit; end; / 另一種寫法 declare jobno number; begin dbms_job.submit( job => :jobno, what => 'SP_SYNC_MES_ITEM;', next_date => SYSDATE, interval => 'SYSDATE + 10/1440' ); dbms_output.put_line(jobno); commit; end; 5. 查詢執行程序 sql> select * from user_jobs; 6. 移除程序 begin dbms_job.remove(141); end; / 7. 暫停程序 begin dbms_job.brok
留言
張貼留言