DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: problems using DBMS_JOB

  1. #1
    Join Date
    Oct 2008
    Posts
    2

    problems using DBMS_JOB

    Hi, I am using DBMS_JOB for the first time. I created a DBMS_JOB. This job is runs everyday at 6 AM. This job executes INSERT INTO SELECT FROM .

    When this job ran at 6 AM, it failed because insert statements failed with primary key constraint. Since this run failed, its trying repeatedly after random duration. Is there any way we can stop executing this job repeatedly?

    Please help
    Thanks
    Sandeep

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Quote Originally Posted by rayapudisandeep
    ...it failed because insert statements failed with primary key constraint... Is there any way we can stop executing this job repeatedly?
    It is clear the reason the job is failing has nothing to do with DBMS_JOB, procedure is trying to insert a row with a duplicate PK value.

    As per your question ... I'm pretty sure the job is executed as it was scheduled, if you want a different schedule... just change the schedule or set the job flag as broken which will cause the job not to be executed.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Oct 2008
    Posts
    2
    Thanks for the reply. But what I want to do is:

    - If this job is failed to run because of any reason, it should not be run again.
    - I want the job to be run at specified period ONLY without any automatic retries in case of failures.

    Any help???

    Thanks

  4. #4
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Here is what is happening.

    By design DBMS_JOBS would retry any failed job after 1 minute, 2 minutes, 4 minutes... etc until it reachs 16 failed retries. At this point in time DBMS_JOBS gaves up and marks the job as "broken".

    I would intercept the failure in an EXCEPTIONS section, there you could...
    1- Send an email, page or whatever alter you have in place to the person or team that can do something about it.
    2- Set the job as "broken" so DBMS_JOBS wouldn't try again.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width