10 Replies Latest reply: Nov 30, 2012 8:58 AM by Osama_Mustafa RSS

    scheduler job

    923036
      Hi,

      I have created a window with duration of 3 minutes . and i want to create a job , that should be assigned to that window. how should i create a job. if i mention
      window_name in create_job , it is throwing error. so how can i do it?
        • 1. Re: scheduler job
          Osama_Mustafa
          Start --> All Programs -->Accessories --> System Tools ---> Scheduled Tasks

          Follow the screen and fill what its need .
          • 2. Re: scheduler job
            923036
            Hi,

            I'm creating dbms_scheduler jobs not window jobs.
            • 3. Re: scheduler job
              Osama_Mustafa
              BEGIN
                DBMS_SCHEDULER.create_schedule (
                  schedule_name   => '<NAME>',
                  start_date      => SYSTIMESTAMP,
                  repeat_interval => '<Choose how you want to repeat this task >',
                  end_date        => NULL,
                  comments        => '<Your Comments>');
              END;
              /
              • 4. Re: scheduler job
                923036
                HI osama,

                Actually i had created a 'SCHEDULE' .i.e assigned to window of 3 minutes. Now my requirement is i want to create a job , that should be assigned to that window .
                • 5. Re: scheduler job
                  Osama_Mustafa
                  Post what you did , You said what you want one by one .
                  • 6. Re: scheduler job
                    923036
                    Hi,

                    begin
                    dbms_scheduler.create_schedule
                    (
                    schedule_name => 'scheuler1',
                    start_date => systimestamp,
                    repeat_interval => 'FREQ=MINUTELY; INTERVAL=10;',
                    comments=> ' scheduler for windows'
                    );
                    end;



                    begin
                    dbms_scheduler.create_window
                    (
                    window_name=> 'window1',
                    resource_plan => NULL,
                    schedule_name => 'scheuler1',
                    duration => interval '3' minute,
                    comments => 'window should be closed after 3minutes'
                    );
                    end;

                    I had created a scheduled i.e assigned to a window. now i want to create a job which should use this window.
                    • 7. Re: scheduler job
                      Osama_Mustafa
                      Windows provide the link between the scheduler and the resource manager, allowing different resource plans to be activated at different times

                      and you connect job to scheduler like this :
                        DBMS_SCHEDULER.create_job (
                          job_name      => '<JOB Name>',
                          program_name  => '<Prgram_name>',
                          schedule_name => '<scheuler1>',
                          enabled       => TRUE,
                          comments      => '<COMMENTS>');
                      • 8. Re: scheduler job
                        923036
                        HI,

                        My requirement is , i should have to create a job of 5 minutes.if it is running more than 3 minutes it should stop automatically and run on the next day. for that i had created window for my job with window duration is of 3 minutes . my window is closed automatically after 3 minutes the job in that window will be stopped if i assign a job for it.how can i do it.
                        • 9. Re: scheduler job
                          JohnWatson
                          920033 wrote:
                          HI,

                          My requirement is , i should have to create a job of 5 minutes.if it is running more than 3 minutes it should stop automatically and run on the next day. for that i had created window for my job with window duration is of 3 minutes . my window is closed automatically after 3 minutes the job in that window will be stopped if i assign a job for it.how can i do it.
                          I already told you what job attribute to set in order to stop the job when your window closes in tyour previous topic. Since you do not seem inclined to close topics or give points as a thankyou to people who try to assist, I'm not sure I want to help again. However, to assign your job to a window, using the window and schedule you created above, all you do is this:
                          orcl> exec dbms_scheduler.create_job(-
                           job_name=>'myjob',-
                           schedule_name=>'window1',-
                           job_type=>'stored_procedure',-
                           job_action=>'p1');
                          
                          PL/SQL procedure successfully completed.
                          
                          orcl>
                          and then
                          orcl> exec dbms_scheduler.set_attribute(-
                           'myjob','stop_on_window_close',true)
                          PL/SQL procedure successfully completed.
                          
                          orcl>
                          • 10. Re: scheduler job
                            Osama_Mustafa
                            Why you don't post all you want in the first One , as i told you before you post what you want one by one . John gave you what you want . Mark this thread as answered .