How to run jobs in a sequence?

I have created a number of jobs (SQL Server 2008 R2) that refresh tables in a data warehouse using SSIS packages and Transact-SQL stored procedures.  Currently, these jobs are scheduled to run in the correct sequence, separated by a time delay
of more than double the average job execution time (the longest job currently takes about 10 minutes on a lightly used test server).  However, I am worried that instances of unusual server loading may cause delays in processing, which could allow
a dependent job to run before the input data has been fully prepared by its predecessor.
I can only think of two solutions, and I'm not crazy about either of them: (1) combine all steps from all jobs into a single job;  (2) use logging to check the success of each previous job before running the next (maybe by starting each job with
a stored procedure that fails the entire job if it finds the prior job didn't finish).
Are there another options?

Thanks, Piotr
I've been deploying to file system on my DEV server, and deploying to SQL Server for TEST & PROD.  I shall try the master package approach again when I do my next round of development.
Hi AllenN,
I’m writing to follow up with you on this post. Was the problem resolved after performing our action plan steps? If you would like to, you can post a reply to share your solution and I will mark it as answer. That way, other community members could benefit
from your sharing.
Thanks,
Sofiya Li
Sofiya Li
TechNet Community Support

Similar Messages

  • Need HELP (Project Issue) : Having 3 individual VIs, datalogger.vi, start vi, amksms.vi done. (How to run the VIs in sequence order - datalogger start amksms combine into 1 VIs? )

    Need HELP (Project Issue) : Having 3 individual VIs, datalogger.vi, start vi, amksms.vi done.
    (How to run the VIs in sequence order - datalogger > start > amksms combine into 1 VIs? )

    VIs in icon.
    how would it able to run in the sequence order:
    data first, follow by start and lastly amk sms.
    Attachments:
    dsa.jpg ‏10 KB

  • In sm37, how to run job in sequence ?

    Hello,
    In sm37, how  run job1 and job2 in sequence ?  Our requirement is ,once the job1 is excuted then only job2 should be fired.
    Regards,
    Rachel

    You have to modify the Job2 & in the "after job" box you have to enter "Job1" ...
    Please refer to this for details: [http://help.sap.com/saphelp_nw70/helpdata/EN/20/2d513897110872e10000009b38f889/content.htm]
    But note that you cannot schedule job2 as "periodic" in this case.
    If you want to do so you have to use "SAP Events".
    BR,
    Suhas
    Edited by: Suhas Saha on Apr 19, 2010 11:17 AM

  • How to run jobs in oracle 10g

    I have created the following job,
    BEGIN
    -- Job defined entirely by the CREATE JOB procedure.
    DBMS_SCHEDULER.create_job (
    job_name => 'Update_Status',
    job_type => 'PLSQL_BLOCK',
    job_action => 'BEGIN ;updateStatus; END;',
    start_date => SYSTIMESTAMP,
    repeat_interval => 'freq=minutely; bysecond=0;',
    end_date => NULL,
    enabled => TRUE,
    auto_drop => FALSE,
    comments => 'Job defined entirely by the CREATE JOB procedure.');
    end;
    When I look for the status of the job in the following table
    SELECT *FROM USER_SCHEDULER_JOB_LOG
    The Status field shows Failed. How to make my job runnable what could be reason. Please help to solve this problem.

    Hello,
    this is the forum space for the tool SQL Developer.
    Your question should be asked at Scheduler
    Please mark this question as answered and post again in the correct space.
    Regards
    Marcus

  • How to run Job in this interval

    Hello,
    I am using Oracle 11.2.3.
    I need to run a Job each 3 hours from 9:30 AM till 6:00 PM from Sat - Thur .
    What repeat_interval I have to use ?
    Regards,

    Hi
    SQL> BEGIN
      2  DBMS_SCHEDULER.create_job (
      3  job_name        => 'BANK1',
      4  job_type        => 'PLSQL_BLOCK',
      5  job_action      => 'BEGIN schmaes_name.procedure_name; END;',
      6  start_date      => to_date('01.01.2013 01:00:00','dd/mm/yyyy hh24:mi:ss'),
      7  repeat_interval => 'FREQ=HOURLY; ByDay=Sat, Sun, Mon, Tue, Wed, Thu;ByHour=9,12,15,18;',
      8  end_date        => NULL,
      9  enabled         => TRUE,
    10  comments        => 'Anar edit.');
    11  END;
    12  /
    Thank you

  • How to run job every saturday 8p.m.

    I have run the job weekly i.e. every saturday 8pm
    could you pls advice me what I shoudl do in scheduler

    Hi Nav,
    Schedule it as a database job as below
    BEGIN
      --Create a schedule
      dbms_scheduler.create_schedule (schedule_name => 'RUN_EVERY_FRIDAY_800PM',  start_date=> trunc(sysdate)+18/24,  repeat_interval=> 'FREQ=DAILY; BYDAY=FRI; BYHOUR=20;', comments=>'Runtime: Run at 8pm every Friday'); 
      --Create a Program
      dbms_scheduler.create_program  (program_name=> 'My_Program',  program_type=> 'STORED_PROCEDURE',  program_action=> 'pkg_my.procedure1',  enabled=>true,  comments=>'Call Procedure1 procedure in pkg_my package' ); 
      --Use Schedular and program and create a job
      dbms_scheduler.create_job  (job_name => 'My_Job', program_name=> 'My_Program', schedule_name=>'RUN_EVERY_FRIDAY_800PM', enabled=>true,  auto_drop=>false,  comments=>'Run My_Program every friday 8pm');
    END; In above I have use 3 steps, Advantage of this is
    01. when you want to use same things for another job you can easily use it. For a example if you wnat to run anther program in "Every Friday 8pm" then you can use same scheduler for that job as well.
    02. If you use same schedule for multiple jobs and if you change that schedule, then all jobs whish were use that schedule will affect. So you can easily group jobs together.
    But if you wnat to run that progarm only ones then you can use below code to do that
    DBMS_SCHEDULER.create_job (
        job_name        => 'My_Job',
        job_type        => 'PLSQL_BLOCK',
        job_action      => 'BEGIN pkg_my.procedure1; END;',
        start_date      =>  trunc(sysdate)+18/24,
        repeat_interval => 'FREQ=DAILY; BYDAY=FRI; BYHOUR=20;',
        end_date        => NULL,
        enabled         => TRUE,
        comments        => 'Run My_Program every friday 8pm');Thanks

  • How to run Jobs

    HI Friends,
    In my ODI project i have 15 jobs in one package.
    Suppose the number 5th job is failed then i need to restart the 5th job .
    But can it possible in ODI through (any workflow or package)
    if the number 5th job failed then its automatically restart from 5th job .
    Thanks,
    Lony

    Hi Lony,
    ODI can restart the failed job automatically with Agent.
    You need to generate scenario for your desired package and expand it, you can find Scheduling.
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/odi/10g/10135/creating_scheduling_scenario/creating_scheduling_scenario.htm
    Go to-> Scheduling-> <your scheduling>-> Execution Cycle-> Under Constraints Check Number of Attempts On Failure. Which will restart your job "automatically" in case of failure.
    Thanks,
    Guru

  • URGENT: How to run threads in sequence?

    Dear experts, I am new to writing threads. I would like to know how to run threads in sequence? How do I know when a thread finishes its task?
    In the following code, classes Process_A(), Process_B(), Process_C() and Process_D() are subclasses of Class Thread.
    I'd like to know if I am using the join() function correctly? My intention is to wait for the previous process to finish before running the current process.
    Could anyone kindly give me some solutions on how to run the processes in sequence?
    Thanks!!
    =============================================================
    Thread process;
    Vector process_names = new Vector();
    process_names.add("a");
    process_names.add("b");
    process_names.add("c");
    for(int i=0; i<process_names.size(); i++)
    String process_name = (String) process_names.elementAt(i);
    if(process_name.equals("a"))
    process = new Process_A();
    else if(process_name.equals("b"))
    process = new Process_B();
    else if(process_name.equals("c"))
    process = new Process_C();
    else if(process_name.equals("d"))
    process = new Process_D();
    timer = new javax.swing.Timer(1000, new ProcessListener());
    timer.start();
    // ProcessListener()
    class ProcessListener implements ActionListener {
    public void actionPerformed(ActionEvent evt) {
    if(process!=null)
    if(process.isAlive())
    try
    process.join();
    catch(Exception ex)
    ex.printStackTrace();
    process.start();

    just look at this simple example u will get to know how to use join method
    This does exactly what u want
    class callme
    void call(String msg)
    System.out.println("["+msg);
    Try
    Thread.sleep(1000);
    catch(InterruptedException e)
    System.out.println("interrupted");
    System.out.println("]");
    class caller implements Runnable
    String msg;
    Callme target;
    Thread t;
    Public Caller(Callme targ, String s)
    target=targ;
    msg=s;
    t=new Thread(this);
    t.start();
    public void run()
    target.call9msg);
    class Synch
    public static void main(String arg[])
    Callme target=new Callme();
    Caller ob1=new Caller(target,"hello");
    Caller ob2=new Caller(target,"Synchronized");
    Caller ob3=new Caller(target,"world");
    Try
    ob1.t.join();
    ob2.t.join();
    ob3.t.join();
    catch(InterruptedException e)
    System.out.println("interrupted");
    waiting for dukes

  • Running jobs on Always On setup

    Hello there.
    I am trying to figure out how to run jobs in a SQL Server Always On setup.
    Basically, I need to add a piece of logic in my jobs that will test if the database (or replica) is the primary. If so, the job will continue, otherwise will silently stop.
    Does anybody have a ready to go query that does it?
    Thank you!

    You are not the first one needing this. ;-) I have published a check-function on my blog:
    http://sqlblog.dangerous.it/2012/10/is-that-db-online.html
    Based on that function we are using a stored procedure that throws an error when the DB is not online. We add a first step that calls this sproc and on error just Ends the Job with success state.
    CREATE
    PROCEDURE
    [dbo].[usp_CheckDBAndBailout]
    @dbname
    sysname
    AS
    BEGIN
    if
    (SELECT
    Admin.dbo.ufn_IsDatabaseOnline(@dbname))=1
    begin
    print
    'fine'
    end
    else
    begin
    RAISERROR
    ('DB
    not Online',
    -- Message text.
    16
    -- Severity.
    1
    -- State.
    end
    END

  • How to stop a running job in 10g Scheduler?

    The following is a duplicate post. I posted the following to the general database forum before seeing that otn has a new scheduler forum:
    I am not able to find in the Admin Guide a method to stop a currently running instance of a job in the 10g scheduler.
    In 9i, I run the following script calling DBMS_JOB.broken and DBMS_JOB.remove to shut down currently running jobs:
    DECLARE
    jobid NUMBER;
    CURSOR c1
    IS
    SELECT job
    FROM dba_jobs
    WHERE priv_user = 'ME';
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1
    INTO jobid;
    EXIT WHEN c1%NOTFOUND;
    DBMS_JOB.broken (jobid, TRUE);
    COMMIT;
    DBMS_JOB.remove (jobid);
    COMMIT;
    END LOOP;
    CLOSE c1;
    END;
    How may I create similar code to shut down currently running jobs using DBMS_SCHEDULER in 10g? According to the Admin Guide, disabling jobs with the force option will still allow the job to finish.
    How can I terminate a running job in 10g?

    You can stop a currently running job using the STOP_JOB api.
    STOP_JOB Procedure
    This procedure stops currently running jobs or all jobs in a job class. Any instance of the job will be stopped. After stopping the job, the state of a one-time job will be set to SUCCEEDED whereas the state of a repeating job will be set to SCHEDULED or COMPLETED depending on whether the next run of the job is scheduled.
    Syntax
    DBMS_SCHEDULER.STOP_JOB (
    job_name IN VARCHAR2
    force IN BOOLEAN DEFAULT FALSE);
    Parameters
    Table 83-44 STOP_JOB Procedure Parameters
    Parameter Description
    job_name
    The name of the job or job class. Can be a comma-delimited list. For a job class, the SYS schema should be specified.
    If the name of a job class is specified, the jobs that belong to that job class are stopped. The job class is not affected by this call.
    force
    If force is set to FALSE, the Scheduler tries to gracefully stop the job using an interrupt mechanism. This method gives control back to the slave process, which can update the status of the job in the job queue to stopped. If this fails, an error is returned.
    If force is set to TRUE, the Scheduler will immediately terminate the job slave. Oracle recommends that STOP_JOB with force set to TRUE be used only after a STOP_JOB with force set to FALSE has failed.
    Use of the force option requires the MANAGE SCHEDULER system privilege.
    Setting force to TRUE is not supported for jobs of type executable.
    Usage Notes
    STOP_JOB without the force option requires that you be the owner of the job or have ALTER privileges on that job. You can also stop a job if you have the CREATE ANY JOB or MANAGE SCHEDULER privilege.
    STOP_JOB with the force option requires that have the MANAGE SCHEDULER privilege.

  • How to run a job in background programatically after 10 sec

    Hi Forum,
    Can anyone tell me How to run a job in background programatically after 10 sec..
    Thanks in advance

    Hi,
    Here is the example code
    *Submit report as job(i.e. in background) 
    data: jobname like tbtcjob-jobname value
                                 ' TRANSFER TRANSLATION'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    * Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum    " You need to give the Date for execution the Job
                sdlstrttm        = sy-uzeit    " You need to give the Time for execution the Job
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    * Insert process into job
    SUBMIT zreport and return
                    with p_param1 = 'value'
                    with p_param2 = 'value'
                    user sy-uname
                    via job jobname
                    number jobcount.
      if sy-subrc > 0.
                                           "error processing
      endif.
    * Close job
      starttime-sdlstrtdt = sy-datum + 1.
      starttime-sdlstrttm = '220000'.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed            = starttimeimmediate
                targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    Regards
    Sudheer

  • How to run long background jobs in ADF applications

    Hi,
    I'm looking for some guidance on how to run an asynchronous job within an ADF application with proper progress notification in the current page.
    Let's assume we have some long running task (e.g. generating notification emails from a bunch of rows in my view object and send them) with the corresponding classes implemented in the DataModel as part of the business logic (e.g. a class that sends a mail to a given recipient).
    Let's assume all the relevant methods can be exposed in the appmodule's client interface so they can be invoked from the ViewController if needed.
    In my jspx page I have implemented the standard af:poll+af:progressIndicator mechanism to give feedback about the running task, backed by a custom BoundedRangeModel
    with methods getValue() and getMaximum(). This works.
    However, all the examples I've found on the net are very very simplistic and only deal with simple counters or countdowns.
    But how to actually implement the whole mechanism in a real life scenario? How do I run the job itself and make it give feedback to my BoundedRangeModel class
    (which in turn is used by the progressIndicator on the page)?
    Is there a recommended way to do this within ADF apps? I've tried to search something about asynchronous method execution in ADF but there seems to be nothing out there.
    Do I need to use standard Java techniques such as a separate Thread running a Runnable worker? Should I use an observer/observable pattern to notify BoundedRangeModel
    and update its internal variables (current value and maximum)? Would this work across a Datacontrol interface?
    Is anything of this allowed within the ADF framework or I'm just gonna break the whole framework model because do-it-yourself concurrent programming isn't allowed in a multithreaded pooled environment?
    Some explanation about the current recommended best practices and/or some practical examples or articles about that would be great.
    (BTW: I'm using version 11.1.1.2.0 and yes, I've checked the contextual events thing too, but that's just an inter-page communication mechanism so it has has nothing to do with what I need to do.)

    Hi
    I have implement a "Runner" class to generate a pdf to every customer of a mailmerge file, which was uploaded. Its simply easy to do something like this. Just add a button, bound the button with a methode out of you applicationModule and start your implementing Thread in this methode.
    public class Runner implements Runnable {
        private String docFileName;
        private String csvFileName;
        private byte[] csvData;
        private byte[] docData;
        private FtpClient client;
        private String category;
        public Runner(String category, String docFileName, byte[] docData,
                      String csvFileName, byte[] csvData, FtpClient client) {
            this.category = category;
            this.docFileName = docFileName;
            this.docData = docData;
            this.csvFileName = csvFileName;
            this.csvData = csvData;
            this.client = client;
        public void run() {
    }In your applicationModule, you can start your Runner like this:
            Runner runner =
                new Runner(category, docFileName, docData, csvFileName, csvData, client);
            new Thread(runner).start();And to the problem with your progressBar. I would create a managedBean with a HashMap<String, HashMap<String, String>>. Every thread you start, add a HashMap<String, String> to this hashmap with the id of the username/session/whatever (must be bound to the user, which starts the thread). This added HashMap<String, String> should be used by your thread to put some status-information into. Now you can try to bind this info to your progressBar.
    I dont know if this will work, it is just an idea ;-)
    Regards
    Majo

  • Re:How to determine the long running jobs in a patch

    Hi ,
    How to determine the long running jobs in a patch .
    Regards

    Hi,
    Check the below MY ORACLE SUPPORT note:
    Note.252422.1 .... Check Completed Long Running Jobs In Oracle Apps.
    Best regards,
    Rafi

  • How to cancel an active/running job in BW?

    Hi All,
    I have a job running in the system for 2 hrs now. I want to cancel it, please suggest, how to do the same.
    Thanks,
    Raj

    Hi ,
    Please follow the steps as metioned below: go to T-code SM37, enter the below details
    Job name = * or BI*
    User name = *
    Job status = Active ( uncheck rest all )
    Execute ( here you will find all the active running jobs ).Click on the job--> Go to Job -->Cancel active job. It should cancel the job.
    Or you can also get the PID of the job and cancel the job by following the steps below
    Goto sm50 ---> locate the process with the PID ---> select the Process -
    > menu bar ---> cancel without core.

  • How to run a ABAP Program in Batch JOB

    How to run a ABAP Program in Batch JOB ?

    Hello Manish,
    Using transaction SM36 you can define the batch job along with the start conditions for that job.
    1. Transaction SM36.
    2. Give the Z name of the job in the 'Job Name' input field.
    3. Click on 'Steps' button from the application toolbar.
    4. On the 'Create Step 1' dialog box, give the name of the ABAP program in the 'ABAP Program' section' along with the variant.
    5. Click on 'Check Input' button from the dialog box.
    6. Click on 'Save' button from the dialog box once the check is successful.
    7. One list will be shown. Click on Back button from the standard toolbar.
    8. Click on 'Start Conditions' button from the application toolbar. Specify the start condition e.g. immediate. Click on save.
    9. The job staus is now scheduled.
    10.Click on Save button from the standard toolbar of SM36. The job status will be released.
    Using SM37 you can monitor the status of the job.
    This will sort out your problem.
    PS If the answer solves your query, plz reward points.
    Regards

Maybe you are looking for