{"id":108,"date":"2009-09-09T09:33:00","date_gmt":"2009-09-09T07:33:00","guid":{"rendered":"http:\/\/antynet.pl\/index.php\/2009\/09\/09\/oracle-jobs\/"},"modified":"2010-08-24T22:38:41","modified_gmt":"2010-08-24T20:38:41","slug":"oracle-jobs","status":"publish","type":"post","link":"https:\/\/www.antynet.pl\/index.php\/2009\/09\/09\/oracle-jobs\/","title":{"rendered":"ORACLE JOBS"},"content":{"rendered":"<p><span style=\"font-weight: bold;\">check:<\/span><br \/>SELECT * FROM dba_jobs;<br \/>SELECT * FROM dba_jobs_running;<br \/>SELECT schema_user,job,what,last_date,this_date,next_date,total_time\/3600 hours,failures,broken FROM dba_jobs;<br \/>column TOTAL_TIME determine the time which system spend run this job from first initialization, it is not time of present us <br \/>column THIS_DATE is filled when job is still executing and show time present execution time<\/p>\n<p><span style=\"font-weight: bold;\">new job:<\/span><br \/>declare<br \/>jobnr number;<br \/>begin<br \/>dbms_job.submit(job=>jobnr,<br \/>what=>&#8217;dbms_output.put_line(&#8221;ble&#8221;);&#8217;,<br \/>next_date=>to_date(&#8217;10:00 09\/09\/2009&#8242;,&#8217;HH24:MI DD\/MM\/YYYY&#8217;),<br \/>interval=>&#8217;SYSDATE+1&#8242;);<br \/>end;<br \/>\/<\/p>\n<p><span style=\"font-weight: bold;\">hand launch<\/span> (only by owner, in the other case ORA-23421, even for sys user), beware on change next_date which will by calculated from now<br \/>example. interval: sysdate+1:<br \/>exec DBMS_JOB.RUN(JOB => [nr]);<\/p>\n<p><span style=\"font-weight: bold;\">set state BROKEN<\/span> (only by owner, in the other case ORA-23421, even for sys user):<br \/>exec DBMS_JOB.BROKEN(JOB => [nr], BROKEN => TRUE);<\/p>\n<p><span style=\"font-weight: bold;\">unset state BROKEN <\/span>(only by owner, in the other case ORA-23421, even for sys user):<br \/>exec DBMS_JOB.BROKEN(JOB => [nr], BROKEN => FALSE, NEXT_DATE => TO_DATE(\u201910:00 01\/01\/09\u2032, \u2018HH24:MI MM\/DD\/YY\u2019));<\/p>\n<p><span style=\"font-weight: bold;\">change job<\/span> (must be set all arguments, if any is unchange we set NULL):<br \/>exec DBMS_JOB.CHANGE(JOB => [nr], NEXT_DATE=>null, WHAT=>null,  INTERVAL => \u2018SYSDATE + 3\u2032);<\/p>\n<p><span style=\"font-weight: bold;\">remove job<\/span> (only by owner, in the other case ORA-23421, even for sys user):<br \/>exec DBMS_JOB.REMOVE(JOB => [nr]);<\/p>\n<p><span style=\"font-weight: bold;\">how to set time:<\/span><br \/>sysdate+1 #from present time + 1 day<br \/>trunc(sysdate)+1 #from 12.00 AM +1day<br \/>trunc(sysdate)+17\/24    #17.00 PM today<\/p>\n<p><span style=\"font-weight: bold;\">check time:<\/span><br \/>SELECT to_char(trunc(sysdate+1) + 90\/1440, 'MM\/DD\/YYYY HH:MI AM&#8217;) FROM dual;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>check:SELECT * FROM dba_jobs;SELECT * FROM dba_jobs_running;SELECT schema_user,job,what,last_date,this_date,next_date,total_time\/3600 hours,failures,broken FROM dba_jobs;column TOTAL_TIME determine the time which system spend run this job from first initialization, it is not time of present us column THIS_DATE is filled when job is still executing and show time present execution time new job:declarejobnr number;begindbms_job.submit(job=>jobnr,what=>&#8217;dbms_output.put_line(&#8221;ble&#8221;);&#8217;,next_date=>to_date(&#8217;10:00 09\/09\/2009&#8242;,&#8217;HH24:MI DD\/MM\/YYYY&#8217;),interval=>&#8217;SYSDATE+1&#8242;);end;\/ hand launch (only by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[80],"tags":[25],"class_list":["post-108","post","type-post","status-publish","format-standard","hentry","category-oracle","tag-oracle-jobs"],"_links":{"self":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/comments?post=108"}],"version-history":[{"count":1,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/108\/revisions"}],"predecessor-version":[{"id":182,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/posts\/108\/revisions\/182"}],"wp:attachment":[{"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/media?parent=108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/categories?post=108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antynet.pl\/index.php\/wp-json\/wp\/v2\/tags?post=108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}