Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to obtain DBMS_SCHEDULER log id from within program being scheduled

Re: Is it possible to obtain DBMS_SCHEDULER log id from within program being scheduled

From: Neil <neil.emery_at_ds-s.com>
Date: 1 Jun 2005 01:56:23 -0700
Message-ID: <1117616183.750126.37110@g47g2000cwa.googlegroups.com>


Hi Daniel,

Try the following.

begin

  dbms_scheduler.create_job(job_name     => 'long_sleep',
                            job_type     => 'PLSQL_BLOCK',
                            job_action   => 'begin
dbms_lock.sleep(600); end;');
  dbms_scheduler.enable('long_sleep');
end;

col job_Action for a40
col additional_info for a40
SET LINES 100 ttitle "Jobs"

select to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') ttime, job_name, job_type, job_action, state
from dual, user_scheduler_jobs
where job_name = 'LONG_SLEEP'
/

ttitle "Running Jobs"

select to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') ttime, a.job_name, a.session_id, a.slave_process_id, to_char(a.elapsed_time, 'hh24:mi:ss') elapsed_time
from dual, user_scheduler_running_jobs a where job_name = 'LONG_SLEEP'
/

ttitle "Scheduler Job Logs"

select to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') ttime, a.status,

       to_char(a.log_date, 'dd-mon-yyyy hh24:mi:ss')  log_date,
       operation

from dual, user_scheduler_job_log a
where job_name = 'LONG_SLEEP'
/

ttitle "Running Job Details"

select to_char(sysdate, 'dd-mon-yyyy hh24:mi:ss') ttime,

       to_char(a.log_date, 'dd-mon-yyyy hh24:mi:ss')  log_date,
       a.additional_info

from dual, user_scheduler_job_run_details a where job_name = 'LONG_SLEEP'
/

The second two queries do not return anything until the job ends.

Am i missing something here?

Chers,

Neil Received on Wed Jun 01 2005 - 03:56:23 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US