Do not use on any
shared computer
September 8, 2008 04:51am pdt
 
[x]
Attachment Details

Running a job on a particular instance within the RAC

Tags: oracle, dbms_scheduler, rac
Have only asked one question in the past, but now I need help so here goes -- as clearly as I can...

I have a job that needs to be run on a regular basis.  The job takes some text files (payroll data) that is downloaded from a mainframe and imports it into our newly designed system written in .net and Oracle (read, NOT mainframe).  The job is an Oracle Scheduler Job and my database is Oracle 10g RAC.

From what I understand of DBMS_SCHEDULER, I can specify a "service" under which to run the job, and this supposedly will get the job to run only on the instance I specify.  This is what I WANT to do since the files are copied into the same machine every night, therefore, run the job from the instance on that machine.  My problem is that I cannot find documentation on how to set this up completely right.

My script for setting up the job is below... what am I missing?

BEGIN
  SYS.DBMS_SCHEDULER.CREATE_JOB
    (
       job_name        => 'TLB_CORE_JOB'
      ,start_date      => TO_TIMESTAMP_TZ('2007/10/25 02:00:00.000000 -05:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
      ,repeat_interval => 'FREQ=DAILY;BYHOUR=2'
      ,end_date        => NULL
      ,job_class       => 'AUTO_TASKS_JOB_CLASS'
      ,job_type        => 'STORED_PROCEDURE'
      ,job_action      => 'TLB_CORE_PKG.MAIN'
      ,comments        => 'This job will run the core import processes, including updating people, their addresses, and the Labor Distribution table.'
    );
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'RESTARTABLE'
     ,value     => FALSE);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'LOGGING_LEVEL'
     ,value     => SYS.DBMS_SCHEDULER.LOGGING_RUNS);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'MAX_FAILURES'
     ,value     => 1);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE_NULL
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'MAX_RUNS');
  BEGIN
    SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
      ( name      => 'TLB_CORE_JOB'
       ,attribute => 'STOP_ON_WINDOW_CLOSE'
       ,value     => FALSE);
  EXCEPTION
    -- could fail if program is of type EXECUTABLE...
    WHEN OTHERS THEN
      NULL;
  END;
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'JOB_PRIORITY'
     ,value     => 3);
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'SCHEDULE_LIMIT'
     ,value     => '+001 00:00:00');
  SYS.DBMS_SCHEDULER.SET_ATTRIBUTE
    ( name      => 'TLB_CORE_JOB'
     ,attribute => 'AUTO_DROP'
     ,value     => FALSE);

  SYS.DBMS_SCHEDULER.ENABLE
    (name                  => 'TLB_CORE_JOB');
END;
/
Start your free trial to view this solution
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

Question Stats
Zone: Database
Question Asked By: joebednarz
Solution Provided By: MikeOM_DBA
Participating Experts: 1
Solution Grade: A
Views: 49
Translate:
Loading Advertisement...
 
[+][-]Accepted Solution by MikeOM_DBA

Rank: Wizard

Accepted Solution by MikeOM_DBA:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by joebednarz
Author Comment by joebednarz:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
[+][-]Author Comment by joebednarz
Author Comment by joebednarz:

All comments and solutions are available to Premium Service Members only.

Start your 7-day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
20080723-EE-VQP-34 / EE_QW_2_20070628