DBMS_JOB runtime problem
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: DBMS_JOB runtime problem

  1. #1
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818

    DBMS_JOB runtime problem

    I'm (obviously) new to DBMS_JOB. The apps we run never used it, preferring OS scheduling.

    Anyway - I'm trying to get a job to run and it appears not to work, although to my untrained eye it should.

    Here's the SQL trail with my comments in /* QUOTES */

    SQL >
    SQL >
    SQL >exec say_hello;
    Hello World .....
    25-Apr-2003 01:21:37

    /* THE PROCEDURE say_hello USES DBMS_OUITPUT.PUT_LINE to Say 'Hello' AND SHOW THE DATE TIME */


    /* CREATE JOB TO RUN THE PROCEDURE IN A FEW MINUTES TIME */

    SQL > DECLARE
    2 l_job NUMBER;
    3 BEGIN
    4 DBMS_JOB.SUBMIT(job=> l_job,
    5 what=> 'say_hello;',
    6 next_date => SYSDATE+(1/24/20) );
    7* END;
    SQL >/
    PL/SQL procedure successfully completed.

    /* CHECK WHEN IT SHOULD RUN ... Note: Its about 01:26 now */

    SQL >SELECT TO_CHAR(SYSDATE+(1/24/20),'dd mon yy hh:mi') from dual;

    TO_CHAR(SYSDATE
    ---------------
    25 apr 03 01:30

    SQL >
    SQL >SELECT TO_CHAR(SYSDATE,'dd mon yy hh:mi') from dual;

    TO_CHAR(SYSDATE
    ---------------
    25 apr 03 01:31

    /* DEADLINE EXPIRES AND JOB APPEARS NOT TO HAVE RUN */
    /* SO CHECK THE JOB ID */

    SQL >SELECT job FROM user_jobs;

    JOB
    ----------
    41

    /* AND MANUALLY RUN ... */

    SQL >BEGIN
    2 DBMS_JOB.RUN(41);
    3 END;
    4 /
    Hello World .....
    25-Apr-2003 01:32:14

    PL/SQL procedure successfully completed.

    /* WHAT HAVE I DONE WRONG? */

  2. #2
    Join Date
    Aug 2002
    Location
    Bangalore, India
    Posts
    405

    Re: DBMS_JOB runtime problem

    Originally posted by JMac

    SQL > DECLARE
    2 l_job NUMBER;
    3 BEGIN
    4 DBMS_JOB.SUBMIT(job=> l_job,
    5 what=> 'say_hello;',
    6 next_date => SYSDATE+(1/24/20) );
    7* END;
    SQL >/
    PL/SQL procedure successfully completed.

    Give commit

    and check for last_date column of dba_jobs to check whether the job has run or not.
    -nagarjuna

  3. #3
    Join Date
    Jul 2002
    Posts
    335
    Check also whether the job has a 'broken' status or not.

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