﻿{"id":588,"date":"2015-07-31T10:12:28","date_gmt":"2015-07-31T02:12:28","guid":{"rendered":"http:\/\/www.llku.com\/?p=588"},"modified":"2015-07-31T10:12:28","modified_gmt":"2015-07-31T02:12:28","slug":"oracle%e5%88%9b%e5%bb%bajob%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/www.llku.com\/?p=588","title":{"rendered":"Oracle\u521b\u5efaJob\u547d\u4ee4"},"content":{"rendered":"<p>\n\t&#8211;\u83b7\u53d6\u65f6\u95f4\u548c\u5e8f\u5217<br \/>\n\tcreate sequence numbincrease_s;<br \/>\n\tcreate table machineTime(seq number,mtime date);\n<\/p>\n<p>\n\t&#8211;\u5b58\u50a8\u8fc7\u7a0b<br \/>\n\tcreate or replace procedure getMachineTime as<br \/>\n\tbegin<br \/>\n\t&nbsp; insert into machineTime values (numbincrease_s.nextval,sysdate);<br \/>\n\t&nbsp; commit;<br \/>\n\tend;\n<\/p>\n<p>\n\t&#8211;\u5b9a\u4e49jobs\u8c03\u7528\u4e0a\u8ff0\u5b58\u50a8\u8fc7\u7a0b,\u4e3a\u4e86\u770b\u51fa\u6548\u679c\u4e00\u5206\u949f\u6267\u884c\u4e00\u6b21<br \/>\n\tdeclare<br \/>\n\t&nbsp; jobs number;<br \/>\n\tbegin<br \/>\n\t&nbsp; sys.dbms_job.submit(jobs, &#39;getMachineTime;&#39;, sysdate, &#39;sysdate+1\/1440&#39;);<br \/>\n\t&nbsp; commit;<br \/>\n\tend;\n<\/p>\n<p>\n\t&#8211;\u5220\u9664Job<br \/>\n\t\/*begin<br \/>\n\t&nbsp; &#8211;select job from user_jobs;<br \/>\n\t&nbsp; sys.dbms_job.remove(108); &#8211;job_id<br \/>\n\t&nbsp; commit;<br \/>\n\tend;*\/\n<\/p>\n<p>\n\t&#8211;select * from dba_jobs;<br \/>\n\t&#8211;select * from all_jobs;<br \/>\n\t&#8211;select * from user_jobs;\n<\/p>\n<p>\n\t&#8211;\u4e0b\u9762\u662f\u5e26\u53c2\u6570\u7684\u5b58\u50a8\u8fc7\u7a0b\u7684\u8c03\u7528<br \/>\n\t\/*begin<br \/>\n\t&nbsp; sys.dbms_job.submit(job =&gt; :job,<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; what =&gt; &#39;declare s1 varchar2(200); s2 varchar2(200); begin xxx.xxxxxx(s1,s2); end;&#39;,<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; next_date =&gt; sysdate,<br \/>\n\t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interval =&gt; &#39;sysdate+1\/1440&#39;);<br \/>\n\t&nbsp; commit;<br \/>\n\tend;*\/<br \/>\n\t&#8211;\u8c03\u7528\u7cfb\u7edf\u5b9a\u4e49\u7684\u5b58\u50a8\u8fc7\u7a0b\u7c7b\u4f3c\u4e0a\u8ff0\u65b9\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8211;\u83b7\u53d6\u65f6\u95f4\u548c\u5e8f\u5217 create sequence numbincrease_s; create t &hellip; <a href=\"https:\/\/www.llku.com\/?p=588\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Oracle\u521b\u5efaJob\u547d\u4ee4<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[13],"tags":[103,69],"_links":{"self":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/588"}],"collection":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=588"}],"version-history":[{"count":1,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions"}],"predecessor-version":[{"id":589,"href":"https:\/\/www.llku.com\/index.php?rest_route=\/wp\/v2\/posts\/588\/revisions\/589"}],"wp:attachment":[{"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.llku.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}