Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Submitting dbms_job

Posted on 2014-01-30
5
Medium Priority
?
403 Views
Last Modified: 2014-01-31
DECLARE
    x   NUMBER;
BEGIN
    DBMS_JOB.SUBMIT
  ( job       => X
   ,what      => 'wb_donors_elig_for_conv_proc;'
   ,next_date =>  to_date('31-Jan-2014 06:30','dd-Mon-yyyy hh24:mi')
   ,interval  => 'SYSDATE + 1'
   ,no_parse  => FALSE
  );
    COMMIT;
END;

It will start every day at 6.30a.m. Is there a way to exclude sundays? Help appreciated.
0
Comment
Question by:anumoses
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39821404
If you can, use dbms_scheduler instead of dbms_job.  It is much more flexible.

You can create your own function that returns the 'next' day to run and just have it skip Sunday.

A previous question has an example of using a user-defined function with dbms_job:
http://www.experts-exchange.com/Database/Oracle/Q_24518466.html


>>It will start every day at 6.30a.m.

Note:  Not specifying the EXACT time and using something like sysdate+1 will cause time drift.  It will not be exactly 'tomorrow' at 6:30 AM.

Set up a simple job that does nothing but insert sysdate into a table and test it...
0
 
LVL 6

Author Comment

by:anumoses
ID: 39821425
With oracle version 9 , I cannot use scheduler.
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 1000 total points
ID: 39821481
try using this for your interval, this will skip Sundays and eliminates the schedule drift mentioned above


interval => 'TRUNC(CASE WHEN TO_CHAR(SYSDATE, ''Dy'') = ''Sat'' THEN SYSDATE + 1 ELSE SYSDATE END) + 1 + 6.5 / 24'
0
 
LVL 6

Author Comment

by:anumoses
ID: 39821516
Thanks a lot.
0
 
LVL 6

Author Closing Comment

by:anumoses
ID: 39824016
thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question