Results 1 to 3 of 3

Thread: dbms_scheduler

  1. #1
    Join Date
    Aug 2008
    Posts
    464

    Unanswered: dbms_scheduler -10g R2

    Hi

    I created a job to run a stored procedure like:

    Code:
    BEGIN
    DBMS.SCHEDULER.CREATE PROGRAM 
    (PROGRAM_NAME => 'MYJOB'
    , PROGRAM_TYPE => 'STORED PROCEDURE'
    , PROGRAM_ACTION => 'SCHEMA.STORED_PROC'
    , ENABLED => TRUE);
    END;
    Code:
    BEGIN
    DBMS.SCHEDULER.CREATE SCHEDULE
    (Schedule_name => 'Schedule01'
    , repeat_interval => 'Freq=minutely; interval=1');
    END;
    and

    Code:
    BEGIN
    DBMS.SCHEDULER.CREATE_JOB 
    (JOB_NAME => 'JOB01'
    , PROGRAM_NAME => 'MYJOB'
    , SCHEDULE_NAME => 'Schedule01'
    , ENABLED=> TRUE);
    END;
    Everything above compiled fine but when I check ALL_SCHEDULER_JOBS, I can see that FAIL_COUNT=RUN_COUNT

    When I try to run the job manually using the same user that created it:

    Code:
    EXECUTE DBMS_SCHEDULER****N_JOB ('MYJOB');
    or

    Code:
    EXECUTE DBMS_SCHEDULER****N_JOB ('MYJOB',TRUE);
    Note: For some reason when I type RUN_JOB above in this post, it changes to ****N_JOB. Hence the need for this note.

    Anyhow, after attempting to run the job manually, I get

    Code:
    ORA-06512: Not a valid function or procedure name
    ORA-06512: "SYS.DBMS_ISCHED" line 150
    ORA-06512: "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 2
    But the Job_Name does point to a valid Package!! I've checked both the Spec and the Body of the Package.
    Last edited by shajju; 02-20-13 at 09:39.

  2. #2
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    Try to include the owner of the procedure:

    Code:
    PROGRAM_NAME => 'SCOTT.MYJOB'
    I will not read nor answer questions where the SQL code is messy and not formatted properly using [code] tags: http://www.dbforums.com/misc.php?do=bbcode#code

    Tips for good questions:

    http://tkyte.blogspot.de/2005/06/how...questions.html
    http://wiki.postgresql.org/wiki/SlowQueryQuestions
    http://catb.org/esr/faqs/smart-questions.html

  3. #3
    Join Date
    Aug 2008
    Posts
    464
    Sorted.....Syntax Error. Many thanks.
    Last edited by shajju; 02-24-13 at 10:59.

Posting Permissions

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