Schedule Executed weekly except for a specific day of the month

Hi all,
I need to create a schedule that run weekly every sunday at 9 PM, except for 2nd day of the month it will run at 7 AM.
I have created 2 schedules:
1. One to run weekly every sunday at 9 PM, but i don't know from where i can specify the days of the month the schedule will be inactive on it.
* I have tried By Month Day option, and choose all days of the month except second day of the month to run on it.
FREQ=WEEKLY; BYMONTHDAY=1,3,4,5,..,31; BYDAY= SUN; BYHOUR=21;
But, on the schedule preview window as i have designed the schedule from oracle warehouse builder, shows sunday, 02, July for example.
as an execution date for this schedule.
which is not appropriate.
2. Another job is created to run monthly on the 2nd day of the month,
FREQ=MONTHLY; BYMONTHDAY=2; BYDAY= SUN; BYHOUR=7;
So, please advice how to create schedules daily or weekly and neglect some days of month from it.

Hi,
You can use the exclude clause introduced in 10gR2 for this by creating a schedule when your job should not run and excluding it. An example is given below.
Hope this helps,
Ravi.
create or replace procedure print_schedule_dates
   schedule in varchar2,
   start_date in timestamp with time zone default dbms_scheduler.stime(),
   number_of_dates in pls_integer default 10
is
  date_after timestamp with time zone := start_date - interval '1' second;
  next_date timestamp with time zone;
begin
  for i in 1 .. number_of_dates
  loop
    dbms_scheduler.evaluate_calendar_string
     (schedule, start_date, date_after, next_date);
    dbms_output.put_line(to_char(next_date,
                    'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZH:TZM TZR'));
    date_after := next_date;
  end loop;
end;
begin
  dbms_scheduler.create_schedule('monthday2',
    repeat_interval=>'freq=monthly;bymonthday=2');
end;
exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21;exclude=monthday2',sysdate+1,30);
exec print_schedule_dates('FREQ=WEEKLY;BYDAY=SUN;BYHOUR=21',sysdate+1,30);

Similar Messages

  • Function for finding first day of the month !!

    Hi,
    I know we have function to find the last day(DD) of the month. Do we have any functions for finding the first day of the month ??? if not is there any way i can find the first date(DD) of the month .
    Bcoz i m trying to incorporate the logic for finding the first day of the month partition.
    Thank you!!!

    Shahid Ali Tcs wrote:
    There are many solution given by member in relation with your question, and all are correct .
    I want to make u know something else.
    Have you ever think why oracle has given function for last_day but no function for first.....
    I u think this question u will get the answer of your "first day finding " question.
    Because first day is alwasy 01 of every, while last day can be 30,31,29,28.....
    Got my words ........
    One more solution from my side,,,,
    SQL> select '01' || to_char(sysdate,'-MON-YY') from dual;
    '01'||TO_
    01-SEP-09Which is a completely poor way of doing it.
    Using TRUNC or LAST_DAY(..) + 1 will return a DATE datatype result.
    Your method is converting the DATE into a VARCHAR2, which then prevents further processing/date based calculations unless it is explicitly converted back to a DATE again.
    The reason Oracle hasn't provided a FIRST_DAY is because the TRUNC function already caters for it as this works with DATE's as well as NUMBER's, not because the first day is always 1.

  • Is there an alarm/reminders app that would allow me to add reminders on specific days throughout the month?

    The basics is - I work nightshift so I would want an alarm to wake me up before my shift, wake me up after my shift and wake me up at a certain time on my day off. Rather than doing it week by week - is there an app that would let me make alarms/reminders for the full month to save time and effort?

    Try WorkTime. https://itunes.apple.com/us/app/worktime-work-schedule-shift/id594764457?mt=8 You'll need to get the premium paid version for the alarms/reminders.

  • Defining an exit variable for a specific day based on Fiscal Period

    If I do not have Calendar Day time dimension available for reporting is it possible to define a customer exit variable for a specific day.  The days are the first and last day of the financial year?
    Example
    User Input for Fiscal Period: 2009004
    The exit is to define a value for 01.01.2009 and 31.12.2008 (end of last year)
    Thanks

    Hello Niten,
    yes it is possible. Procedure:
    - add a new column in the report structure
    - hide this column
    - create a new text variable in this column (for customer exit)
    - now you can fill this variable during query execution based on 0FISCPER
    You don't want to filter by this variable. Right?
    Buy,
    André

  • How do you set repeat events for a given day of the week

    How do you set a repeat event in calender for a given day of the month.  Expample 3rd Wednesday each month?

    Have you read the app store guidelines yet?
    App Store Review Guidelines:
    http://developer.apple.com/appstore/resources/approval/guidelines.html
    Don't go on what you've seen in the store - for every example you spot, there are hundreds that didn't make it in.
    As well, Apple is tightening up on reviews, etc.
    Loads of discussion on this in the iOS Dev Forums, BTW

  • How can i view appointments for a day in the monthly calendar

    how can i view appointments for a singol day in the monthly calendar?
    Thank you

    It's a problem they need to fix. Make a complaint at http://www.apple.com/feedback/

  • In SQL server, how can I pass a date and return on any specific day of the week (e.g. Sunday/Monday/Wednesday, etc.)

    In SQL server, I want to be able to have a function to return the date of any specific day of the week by passing two parameters. E.g.:
    parameter 1: a selected date (e.g. 8/3/2013)
    parameter 2: any specific day of the week (e.g. Wednesday)
    result: should be 7/31/2013 (8/3/2013 is a Sunday in the week 7/28 - 8/3, so the Wednesday should be 7/31/2013)
    then if I want to get Saturday of that week, I can simply change the second parameter to 'Saturday'
    Thanks.

    Wrong forum:
    http://www.microsoft.com

  • Search for a specific day

    How do i filter a search to find all photos for a specific day and month for all years?

    Hmm.. Well, the only way I've been able to see that is to use filters, and control click on each year-day combo (using control/command click to select more than one entry) and LR will show them all.  You might then drag them into a collection...
    Of if you're not doing this a lot, you could create a smart collection and make a field for each year by "capture date" (which apparently won't let you add wildcard values).
    If nobody else has a better suggestion (quite possibly they will!), then you might put in a feature request to allow Date in smart collections to have a wild card.
    Cheers!

  • Headcount for a specific day

    Hi Gurus,
    I have installed the standard Business Content for Personnel Administration in BW. I have to calculate Headocunt for a specific day ( "As of day") in a query. How do I get about doing this. Any help is deeply appreciated.
    Thanks

    Hello John,
    I assume that user will entry the key date as on which the count has to be shown. This date variable cannot be based on a characteristic. It has to be a formula variable of date type, ready for input.
    Now, Create 2 more formula variables replacement path type for start date and end date.(we need these in calculation)
    Now create a formula(local CKF) and write:
    (key_date > stat_date && key_date < end_date )* count
    This will show the count of employees who joined after start date and who have not left till the key date entered by user.
    Count is the count of unique employee ids. It can be made as a formula in front end or a counter at the back end.
    Best Wishes,
    Mayank

  • How to: Schedule a job to run on the first business day of the month

    In Oracle 10.2.0.3, is there a way to schedule a repeating job to run on the first business day of the month? For example, if the first of the month falls on a weekend (such as Saturday, 11/01/2008), I would like the job to run automatically on Monday (for example, 11/03/2008) instead.

    set serveroutput on
    begin
      print_dates('FREQ=MONTHLY;BYDAY=MON,TUE,WED,THU,FRI;BYSETPOS=1;',
          to_timestamp_tz('01-JAN-2008 12:00:00','DD-MON-YYYY HH24:MI:SS'), 12);
    end;
    Gives:
    TUE 01-JAN-2008 (001-01) 12:00:00 -07:00 -07:00
    FRI 01-FEB-2008 (032-05) 12:00:00 -07:00 -07:00
    MON 03-MAR-2008 (063-10) 12:00:00 -07:00 -07:00
    TUE 01-APR-2008 (092-14) 12:00:00 -07:00 -07:00
    THU 01-MAY-2008 (122-18) 12:00:00 -07:00 -07:00
    MON 02-JUN-2008 (154-23) 12:00:00 -07:00 -07:00
    TUE 01-JUL-2008 (183-27) 12:00:00 -07:00 -07:00
    FRI 01-AUG-2008 (214-31) 12:00:00 -07:00 -07:00
    MON 01-SEP-2008 (245-36) 12:00:00 -07:00 -07:00
    WED 01-OCT-2008 (275-40) 12:00:00 -07:00 -07:00
    MON 03-NOV-2008 (308-45) 12:00:00 -07:00 -07:00
    MON 01-DEC-2008 (336-49) 12:00:00 -07:00 -07:00
    and the print_dates function is (10.2):
    create or replace procedure print_dates
      cal_string in varchar2,
      start_date in timestamp with time zone,
      nr_of_dates in pls_integer
    is
      date_after timestamp with time zone := start_date - interval '1' second;
      next_execution_date timestamp with time zone;
    begin
      dbms_output.put_line('  -->');
      for i in 1 .. nr_of_dates
      loop
        dbms_scheduler.evaluate_calendar_string
         (cal_string, start_date, date_after, next_execution_date);
        dbms_output.put_line(to_char(next_execution_date,
                        'DY DD-MON-YYYY (DDD-IW) HH24:MI:SS TZD TZH TZR'));
        date_after := next_execution_date;
      end loop;
    end;
    [\pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Day of the week and the day of the month out of sync

    I'm not sure this is the right forum to post this, so I apologize in advance.
    When I open iCal on my iPhone 4 in day view I see Oct 29 with a W for Wednesday on top of it although below the days of the month it reads: Tuesday, October 29, 2013.
    Is anyone experiencing this problem? Any solution?
    TIA

    Thanks for replying, ChrisJ4203. It's defintely a problem with Brazilian users. Here's a workaround a countryman posted:
    I've managed to fix it:
    Go to Settings / Mail Contacts and Calendars / Start the week on
    Change from Sunday to Monday.
    It appears people in Brazil are the only ones affected.
    It's a good work-around  while apple does not fix this bug.
    Mesmo problema aqui. Como consertar:
    Ajustes / Mail contatos e calendários / Iniciar a semana em:
    Mude de "Domingo" para "Segunda"
    Parece que somente pessoas no Brasil foram afetadas.
    É uma boa forma de contornar enquanto a Apple não repara a bug.
    iPhone 5 - iOS 7.0.3

  • I have a 2010 Macbook Pro and am a very new user to Mac community. My Mac is just hanging and I am unable to shut it down or do anything at all.  I left it for 2.5 days hoping the battery will run flat but it is not working. Pls help! I am desperate. Tx

    I have a 2010 Macbook Pro and am a very new user to Mac community only started to use this PC a few weeks ago.
    My Mac is just hanging and I am unable to shut it down or do anything at all.  I left it for 2.5 days hoping the battery will run flat but it is not working. Pls help! I am desperate. Tx

    In order to resolve the issue if it occurs again, more info would be helpful as to what occurred prior to the "hang." One potential fix would be to try a Safe Boot:
    After the Mac is completely shut down, push the power button and immediately after the startup tone, hold down the Shift key. The Shift key should be held as soon as possible after the startup tone but not before.
    Release the Shift key when you see the gray Apple icon and the progress indicator (looks like a spinning gear).
    There should be a message that says "SafeBoot." After the Mac is completely booted, try restarting and see if the issue is gone.

  • How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    Create one on the first Tuesday, select repeat/monthly and take the option at the bottom.

  • How do I search for a specific word in the code using Dreamweaver?

    I need to search for a specific word in the code for all of my website pages. How can I do that using Dreamweaver?

    To search local files of a Defined Site in DW...
    Open the Find & Replace tool with Ctrl + F
    Change the Find In dropdown to Entire Current Local Site
    Change the Search dropdown to Text or Source code
    Add the text to find in the Find field
    Add the text to replace in the Replace field (or nothing if you just want to delete the text)
    Hit Replace All

  • How to get column names for a specific view in the scheme?

    how to get column names for a specific view in the scheme?
    TIA
    Don't have DD on the wall anymore....

    or this?
    SQL> select text from ALL_VIEWS
      2  where VIEW_NAME
      3  ='EMP_VIEW';
    TEXT
    SELECT empno,ename FROM EMP
    WHERE empno=10

Maybe you are looking for

  • HELP! Error message appers when i try to open itunes, HELP!

    A small window with a red "X" on the right side of the window appers wen i attempt to open itunes, it reads "iTunes cannot run because some of its reguired files are missing. Please reinstall iTunes." please help -billy

  • Broken Image is Shown in IE OF JSF - Sun App9 Deployment.

    Hi Friends, I have developed Application in Net Beans for JSF(Its a simple App.). When I deploy it onto Sun Application Server, It shows Broken Image. For Image Display I have Done Following..... Please Help. Thanks. IDE : NetBeans 5.5 AppServer : Su

  • Question about encrypt/decrypt

    Hello! I want to transform my inputdata to my databas so no one can read it in clear text. I also have to be able to decrypt the text for process information when I want to. I have tried to use DES but that algorithm seems to use different keys every

  • BadIDException (Map.jhm problem?)

    I am getting a BadIDException exception when i click my help button. My Map.jhm file (and all my other help files) are in a jar file (whih has no subdirectories). I added the iD in my java code by: String urlString = new String("jar:file:c:/test/lib/

  • Global Database Name for OCS Database

    Hi guys, The domain name for the network that I'm installing OCS 10g have a dash in the domainname. When installing the OCS database, it stated that the global database name cannot have a dash. So I change the dash in domain name of the server with a