Home > Database > Mysql Tutorial > Oracle job 学习

Oracle job 学习

WBOY
Release: 2016-06-07 17:13:49
Original
1141 people have browsed it

Oracle job 学习,在plsql中执行如下脚本可以创建一个在每天晚上23点执行的job

Oracle job

在plsql中执行如下脚本可以创建一个在每天晚上23点执行的job

begin

sys.dbms_job.submit(job => :job,   -- job编号

what => 'dbms_output.pub_line(''asdf'');',  -- 执行脚本

next_date => to_date('17-01-2011 16:17:31', 'dd-mm-yyyy hh24:mi:ss'),   -- 下次执行时间

interval => 'trunc(sysdate)+23/24');  -- 执行时间间隔

commit;

end;

其中:interval 参数的几个可能的示范值如下:

A,每5分钟执行一次

interval => 'trunc(sysdate,'mi')+5/24/60'

B,每小时执行一次,整点执行

interval => 'trunc(sysdate,'HH')+1/24'

C,一个小时后执行

interval => 'sysdate+1/24'

更多Oracle相关信息见Oracle 专题页面 ?tid=12

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template