Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Is it possible to obtain DBMS_SCHEDULER log id from within program being scheduled
Hi Daniel,
Try the following.
begin
dbms_scheduler.create_job(job_name => 'long_sleep', job_type => 'PLSQL_BLOCK', job_action => 'begindbms_lock.sleep(600); 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
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
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