2 kfq3312 kfq3312 于 2014.12.18 10:05 提问

ORACLE 中怎么查看 job 的执行时间

我需要查看一个job 上次执行了多次的时间,怎么查?我需要查看一个job 上次执行了多次的时间,怎么查?

2个回答

save4me
save4me   Ds   Rxr 2014.12.18 12:11

In 10g one can find the jobs that are currently running by querying the following view (正在运行的Job)
SELECT job_name, session_id, running_instance, elapsed_time, cpu_used FROM dba_scheduler_running_jobs;

Also one can use the following view to find the history details of job that has run.(历史Job)
SELECT job_name, log_date, status, actual_start_date, run_duration, cpu_used FROM dba_scheduler_job_run_details;

To find the jobs that haven’t succeeded (未成功的Job)
SELECT job_name, log_date, status, actual_start_date, run_duration, cpu_used FROM dba_scheduler_job_run_details where status ‘SUCCEEDED';

lzp_lrp
lzp_lrp   Ds   Rxr 2014.12.30 08:32

建议你在job的开始和最后,往一个日志表插入一条数据,记录开始时间和结束时间,这个查起来非常方便

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!