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]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to Schedule a Report to Run on a Specific Business Day and Not on the Weekend

    Hi,
    Is there a way to schedule a Webi report to run on a specific Business Day? For example, if I wanted a report to run on the 3rd day of every month, but when the 3rd day for a particular month landed on a Saturday or Sunday, then Monday would automatically be chosen instead. Is that possible?
    Thanks,
    Michael

    Hi Michael,
    You can do that by selecting the calendar option while scheduling the report and manually selecting the 3rd day of every month and when the 3rd day for a particular month landed on a Saturday or Sunday, then select the next Monday.
    I dont see any option available for this scenario directly in BO.
    Regards
    Sri Harsha

  • How to schedule a job to run twice within a request set?

    How to schedule a job to run twice within a request set?

    Create one more stage for the same concurrent program.
    Thanks
    Nagamohan

  • How to schedule a job to run only in a  time window

    Hi,
    I need to schedule a job to run every day but sundays from 7am to 6pm. I managed to get it to start at seven like this
    FREQ=WEEKLY;BYDAY=TUE,WED,THU,FRI,SAT;BYHOUR=7;BYMINUTE=0;BYSECOND=0
    how can I set the job to stop at 6pm?
    thanks in advance

    Yes, as far as I could tell you create a resource plan to allocate processor resources, assign a resource plan to the window, then assign the job to a job class which is in turn assigned a resource group within that resource plan. Then when the window is active, it sets the active resource plan for the database so the job will run using this until the window deacivates the resource plan. Unfortunately because the resource plan is database wide, it means you could only really have one time window active at any one time within which to run jobs, I don't think two windows could overlap.
    Easier to work within jobs, but its a shame the job doesn't end itself, rather than having to have the second job, although the second job does enable you to engage in some communication between jobs to cleanly end it, rather than stop it dead. I have a job that runs until a set time each day, but it just works on a loop that sleeps for a few minutes each time, checking for file arrival and processing it, and sending a notification e-mail if it reaches its end time without the file arriving.

  • How to schedule ETL jobs to run periodically after BI Apps is up and runnin

    Hi,
    How do you schedule ETL jobs to run periodically after BI Apps is install and configured? Is there document out there that explains how the ETL scheduling is setup?
    Thanks

    Using DAC we can schedule the ETL to run periodically. In DAC Execute -> Scheduler you can set the date and time for the ETL which need to be scheduled. You can get detail information in guide 'Oracle® Business Intelligence Data Warehouse Administration Console User’s Guide'

  • How to schedule batch jobs to run after another periodically?

    Hi good people,
    I want to schedule batch jobs to run periodically one after another.
    Here is the problem:
    I have scheduled JOB1 to run once a week and I scheduled JOB2 to run after that job (JOB1). The problem is that JOB2 runs only after the first time that JOB1 runs. The second time the JOB1 runs the JOB2 is not started. I presume that the reason for that is that JOB2 is tied to the job number for the JOB1, and since a new job (with the new number) is created every week, the JOB2 is only tied to the first instance of JOB1.
    So does anyone have an idea how to get JOB2 to automatically run every week after JOB1? One idea is to use events, but that I'm hoping that there is a bit cleaner solution..
    Best Regards,
    Armin

    Hi
    Try scheduling both JOB1 & JOB2 in a single job in steps.
    First schedule JOB1 & then give JOB2 in steps.
    Kindly check the following link to do job scheduling in steps:
    http://help.sap.com/saphelp_47x200/helpdata/en/c4/3a7ed1505211d189550000e829fbbd/frameset.htm
    In the above help documentation, look for the topic <b>"job steps"</b> in
    "Background Processing: Concepts and Features"
    hope it helps!
    best regards,
    Thangesh

  • HOW TO SCHEDULE A JOB TO RUN EVERY 30 MINS WITHOUT USING SCHEDULAR?

    Hi,
    I have a requirement where i need to schedule the job to run every 30 mins for 10 am to 10 pm. I ran into problems using odi schedular. Let me tell you what i did..
    i have chosen the active mode between 10 am to 10 pm
    selected on startup/simple.
    and on the repetitions tab selected many times with 30 mins duration.
    the problem was-----
    a)it was not stopping at 10 pm but continues after 10 pm
    b)randomly picking up more times than the 1/2 hour duration.
    looking for---
    a solution that runs my scenario every 30 mins from 10 am to 10 pm without using the schedular...which i cannot trust.
    Regards
    Venkat

    Venkat,
    Here is an alternate solution that i can think of:
    create a package with the following components:
    Variable(Refresh) -> OK -> Execute StartScen(YourJob) in Asynchronous mode -> odiSleep(30 mins) -> Loop to Variable Refresh
    Variable (Refresh) -> KO -> odiSleep(30 mins) {if the refresh of the variable fails to get any value then skip the Job execution}
    The Refresh query should be
    select 1 from dual where to_char(sysdate, 'hh24mi') between  '1000' and '2200'

  • How to schedule a job to run after completion of each run using DBMS_JOB ?

    Hi Gurus,
    Please let me know if the subject requirement can be fulfilled. I want to schedule a job using DBMS_JOB to run a script sequentially after completion of each run.
    Thanks in advance.
    Santosh

    Hi Santosh
    Instead to use the old dbms_job package use the dbms_scheduler and raise / catch events.
    Oracle create dbms_scheduler also for this purpose you need.
    You can find tons of examples on the web.
    Aurelio

  • How to schedule a job in SAP CPS

    Hi,
    I am new to SAP CPS.
    So please tell how to schedule a job in SAP CPS. And which kind of job cam be schedule means BAP report.
    Thanks
    Anurodh

    Hi,
    In the installation and administration guide you'll probably find some examples.
    The Job Definition you need is SAP_AbapRun to run any ABAP.
    You submit this, specify the parameters as desired, and scheduling information, and that should do the trick.
    That is assuming you have already connected CPS to an SAP system.
    Check the topics in the docs within the product and on SDN on:
    - Connecting to an SAP system
    - Submitting Jobs
    - SAP_AbapRun
    Regards,
    Anton.

  • How to schedule a job from r3 to BI daily ?

    Please let me know how to schedule a job frm bi to r3, that is i want to load data from a sd ds to a sd cube in bi. I do not want to use a PC and can i schedule a job daily without a PC, which can run daily after 10pm ,remember its not a manual schedule. Do we have any option to schedule in hourly, weekly, daily from bi to r3. If yes HOW ? i know we can do it thru infopackage group but will the infopackage group accept if its only a single load....I think it should have multiple infopackage rite to add it to a group or can it b a single job as well.
    Edited by: Manohar P on Oct 16, 2008 3:14 PM

    An infopackage group can only run infopackages, and unfortunately, you will need an ABAP program to trigger the event in R/3.  There is plenty of ABAP code in this forum to show you exactly how to do this. 
    Try this:
    Triggering a Process Chain From R/3 pgm
    R/3 Jobs Triggering  BW job
    You can also review OSS Note 135637.  This note will show from R/3 to BI (BW).  But you can reverse the logic to go from BI to R/3.
    Hope this helps.
    My suggestion would be to replace the infopackage group with a process chain, because you can call an ABAP program from a process chain.  You also have many more processes at your disposal using process chains.

  • How to schedule a job poles for a entry in a table.

    Hi All ,
    I have to schedule a job which runs somw stored procedures only on sunday and monday of a week at 3 AM in the morning.
    The condition is that another application puts an entry into a table around 3 AM (some times before and some times late), now my should query
    count in the table and runs the procs , however once its done ,it should do it monday and then it should not run till next sunday.
    I have successfully created a job which keeps failing till it receives the entry and successfully runs the proc once the entry is there...
    However how to schedule this thing ..correctly I need help , I want this job to disable itself on sunday once the procs are run wake up next morning
    run again..and then next week ..
    Following is the job ,
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'TESTING_FIRST_JOB',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN SEODS.test_procedure_11292011(); END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=minutely; byminute=5',
    end_date => NULL,
    enabled => TRUE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    end;
    =====================================================
    and following is the proc...
    create or replace
    procedure
    test_procedure_11292011 as
    var number;
    begin
    insert into SEODS.job_status
    values (systimestamp, 'JOB TEST_PROCEDURE_11292011 HAS STARTED SUCCESSFULLY');
    commit;
    SELECT COUNT(*)
    INTO var
    FROM seods.student_weekend_status;
    if var=0 then
    raise_application_error(-20101, 'There is no record in the student_weekend_status table');
    else
    all_realtime();
    end if;
    insert into SEODS.job_status
    values (systimestamp, 'JOB TEST_PROCEDURE_11292011 HAS FINISHED SUCCESSFULLY');
    commit;
    end;
    Thanks in advance , please help

    Hi,
    This is a known issue in the previous SQL Server version and has been fixed in SQL Server 2012. You should be able to set 90 minutes and the change would be saved in SQL Server 2012.
    http://connect.microsoft.com/SQLServer/feedback/details/346786/ssms-does-not-support-job-schedule-frequencies-greater-than-60-minutes
    Currently, you may schedule the job to occur every 1 hour or you may refer to the suggestion by Latheesh to get around this.
    Thank you for your understanding.
    Tracy Cai
    TechNet Community Support

  • How to schedule a job occurring time for 1 1/2 hour in sql server

    how to schedule a job occurring time for 1 1/2 hour in sql server

    Hi,
    This is a known issue in the previous SQL Server version and has been fixed in SQL Server 2012. You should be able to set 90 minutes and the change would be saved in SQL Server 2012.
    http://connect.microsoft.com/SQLServer/feedback/details/346786/ssms-does-not-support-job-schedule-frequencies-greater-than-60-minutes
    Currently, you may schedule the job to occur every 1 hour or you may refer to the suggestion by Latheesh to get around this.
    Thank you for your understanding.
    Tracy Cai
    TechNet Community Support

  • Schedule multiple jobs/test runs

    Hi,
    Is there a way to schedule multiple jobs/test runs with oats 9.10?
    It seems it is only possible to schedule a single job, by setting the start time in OLT...
    Any suggestions?

    Hi
    I'm talking about functional tests.
    In OLT when you set the auto-pilot you can schedule the test to start after a delay of xxx minutes or at some exact time, however I have never used that fixture.
    Regards
    Alex

  • How to schedule reports to be run and sent from Ad-hoc query.

    Dear Abapers,
    I got a requirement in which the user wants to know how to schedule reports to be run and sent from Ad-hoc query.
    Regards
    Venkat

    Ask him to look more carefully at the menu : Quickview > Execute > Exec. in background, then click on schedule
    Regards,
    Raymond

  • Schedules Error  - Job execution failed because the user who scheduled this

    Hi
    I wonder if anyone can help
    I have a report that I can deliver by email through the BI Publsiher front end without issue. However when I call the report to send by email through my oracle 11G Database, as the same BI User I get the following error message
    "oracle.apps.xdo.servlet.scheduler.ProcessingException: Job execution failed because the user who scheduled this job has no more permission or priviledge to run the job."
    Any suggestions?
    Thanks
    Kev

    The scheduler appears to be the culprit here so try the following:
    1. Open the [repository_home]/Admin/Scheduler/quartz-config.properties file
    2. Add the following entry:
    org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread=true
    3. Restart the environment (xmlpserver)
    4. Rerun the report via the scheduler

Maybe you are looking for

  • Sub folders not showing in Explorer view

    Hi, We have a totally standard Sharepoint 2013 installation. We've noticed this week that in some document libraries when opening them up in Explorer view it doesn't display all the sub folders in that library/folder. It's a real pain when users have

  • ITunes deleted all playlists and purchases

    Help! The other day I closed my iTunes program and it was working perfectly. I came back a few minutes later and re-opened it, only to find that all my playlists, purchases, everything had been deleted! All that is left is a library of songs about 3

  • Mass Closing of QN

    Hello Team, When we make UD for 03 inspection lot, system doesn't close the QN associated with 03 inspection lot. Is there anyway we can close QN associated with 03 inspection lot when we make UD for this type of inspection lot? Other question, is th

  • Can't install updates after upgrading to AP3 :(

    Hi Folks, I'm on latest rev of Snow leo on a 2009 mac pro quad 2.66. I finally bought the upgrade to AP3, installed it no problemo, but it won't let me update it. I think there's something in the system recognizing it as AP 2 b/c i'm receiving the "t

  • Can I unlock a filevault disk in target disk mode?

    I have a macbook pro that is encrypted with filevault. Purchased a new macbook pro with retina and would like to migrate my data from the old laptop to the new one using migration assistant. Is this possible? The macbook pro is running 10.7.4 and the