plsql 建立oracle作業

來源:互聯網
上載者:User

標籤:

--1.plsql中學習job   --學習job  --建表  create table test_job(para_date date);  commit;    insert into test_job values(sysdate);  commit;  select * from test_job;  --建立存貯過程   create or replace procedure test_jobproce   as  begin  insert into test_job values(sysdate);  end test_jobproce;   --建立job  --建立job後預設是執行的   declare  test_job_really number;  begin  dbms_job.submit(test_job_really,‘test_jobproce;‘,sysdate,‘sysdate+1/1440‘);  commit;  end;    ---停止job  25是建立的job test_job_really  begin  dbms_job.broken(25,true);  commit;  end;  --啟動job  begin  dbms_job.run(25);  commit;  end;   --刪除job    begin   dbms_job.remove(25);  commit;  end;   --查看執行結果  select  * from test_job order by test_job.para_date desc;   --查看job  select * from sys.user_jobs     --使用下面的SQL查詢是否JOB還在Running,前提是需要job執行時間不能過短    select * from dba_jobs_running  --除了submit參數外,其餘的幾個參數有:  --運行job dbms_job.run(v_job);        --停止一個job,裡面參數true也可是false,next_date(某一時刻停止)也可是sysdate(立刻停止)。  dbms_job.broke(v_job,true,next_date);        --刪除某個job  dbms_job.remove(v_job);  dbms_job.what(v_job,‘sp_fact_charge_code;‘);       --修改某個job名 修改下一次已耗用時間   dbms_job.next_date(v_job,sysdate);

 

plsql 建立oracle作業

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.