[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 557
  • Last Modified:

Is it any way to find out an execution (elapse) time for the job?

Hi,

Is it any way to find out an execution (elapse) time for the job?

ALL_JOBS.TOTAL_TIME seams indicating a cumulative processing time for a job rather then time per each execution.
0
GoodName
Asked:
GoodName
  • 3
2 Solutions
 
sdstuberCommented:
you have to include such timing in your job and log it somewhere.  There is nothing in Oracle itself to do it.
0
 
sdstuberCommented:
Here's a simple framework to do it.

create table job_time(job_name varchar2(100), started date, duration_in_seconds number);

then change your "what" in your dbms_job to something like this....

declare
   v_start date := sysdate;
begin
    call_your_job_procedure(param1, param2, etc....);
    insert into job_timer (job_name, started, duration_in_seconds)
           values ('your job name', v_start_date,(sysdate-v_start_date) * 86400);
end;
0
 
GoodNameAuthor Commented:
Yes, I offered to my client to create a job_log_table (+proc) but they rejected to add extra table to the production invirontment.

It is surprising that powerful Oracle does not have such simple statistic/historical information about jobs executions.

Any way, thanks guys for your attention.
0
 
sdstuberCommented:
wow I get the answer AND the assist.  You must have really liked my answers.  

Thanks!

:)
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now