10 Replies Latest reply: Sep 13, 2012 4:22 PM by Rnr-Oracle RSS

    dbms_scheduler.run_job not updating last_start_date and last_run_duration

    948012
      I have a job that i want to run on demand. I create the job with disabled status.

      sys.dbms_scheduler.create_job(
           job_name => 'myjob"',
           job_type => 'PLSQL_BLOCK',
           job_action => 'DECLARE
           BEGIN
           action();
      COMMIT;
           END;',
           job_class => 'DEFAULT_JOB_CLASS',
           comments => 'desc',
           auto_drop => FALSE,
           enabled => FALSE);
           sys.dbms_scheduler.set_attribute( name => 'myjob', attribute => 'job_weight', value => 4);
           sys.dbms_scheduler.set_attribute( name => 'myjob', attribute => 'restartable', value => TRUE);

      I call dbms_scheduler.run_job('myjob') when i have to run the job. It runs the job and does my action. But if i query
      select * from user_scheduler_jobs;

      last_start_date and last_run_duration column values are null. I want to know how long my job runs to perform the action. Any idea?