- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - HP-UX
- >
- General
- >
- Re: How to get execution time for an specific job ...
-
- Forums
-
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
- HPE Blog, Austria, Germany & Switzerland
- Blog HPE, France
- HPE Blog, Italy
- HPE Blog, Japan
- HPE Blog, Middle East
- HPE Blog, Russia
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
-
Blogs
- Advancing Life & Work
- Advantage EX
- Alliances
- Around the Storage Block
- HPE Blog, Latin America
- HPE Blog, Middle East
- HPE Blog, Saudi Arabia
- HPE Blog, South Africa
- HPE Blog, UK & Ireland
- HPE Ezmeral: Uncut
- OEM Solutions
- Servers & Systems: The Right Compute
- Tech Insights
- The Cloud Experience Everywhere
-
Information
- Community
- Welcome
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Tips and Tricks
- Resources
- Announcements
- Email us
- Feedback
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Aruba Airheads Community
- Enterprise.nxt
- HPE Dev Community
- Cloud28+ Community
- Marketplace
-
Forums
-
Blogs
-
Information
-
English
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-16-2004 01:01 PM
12-16-2004 01:01 PM
Thanks
Eric
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-16-2004 01:39 PM
12-16-2004 01:39 PM
Re: How to get execution time for an specific job in dba_jobs?
How are you running those jobs?. If they are run through cron, you will see the start time and end time logged in there.
Or you can modify the script to add a logic something like this
SCRIPTNAME=$0
START=$SECONDS
END=$SECONDS
(( DIFF = $END - $START ))
echo "$(DATE): $SCRIPTNAME TOOK $DIFF Seconds " >> /tmp/scripts.log
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-16-2004 01:51 PM
12-16-2004 01:51 PM
Re: How to get execution time for an specific job in dba_jobs?
The TOTAL_TIME column in DBA_JOBS represents the total cumulative time in seconds spent by the system on a job. To determine the execution time of a single execution, you need to view this column after the first execution of the job.
Eg:-
SQL> select job,failures,last_sec,next_sec,total_time,sysdate from dba_jobs;
JOB FAILURES LAST_SEC NEXT_SEC TOTAL_TIME SYSDATE
---------- ---------- -------- -------- ---------- --------
3 0 17:22:47 17:24:47 20 17:23:29
Here the TOTAL_TIME shows the "Total wallclock time spent by the system on this job, in seconds" - i.e. the accumulated time. To check how long it takes to run the job once, we need to check the TOTAL_TIME column after the first run of the job.
.
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-16-2004 03:45 PM
12-16-2004 03:45 PM
Re: How to get execution time for an specific job in dba_jobs?
you should look at NEXT_DATE and INTERVAL.
desc dba_jobs
Name Null? Type
------------------------------- -------- ----
JOB NOT NULL NUMBER
LOG_USER NOT NULL VARCHAR2(30)
PRIV_USER NOT NULL VARCHAR2(30)
SCHEMA_USER NOT NULL VARCHAR2(30)
LAST_DATE DATE
LAST_SEC VARCHAR2(8)
THIS_DATE DATE
THIS_SEC VARCHAR2(8)
NEXT_DATE NOT NULL DATE
NEXT_SEC VARCHAR2(8)
TOTAL_TIME NUMBER
BROKEN VARCHAR2(1)
INTERVAL NOT NULL VARCHAR2(200)
FAILURES NUMBER
WHAT VARCHAR2(4000)
NLS_ENV VARCHAR2(4000)
MISC_ENV RAW(32)
INSTANCE NUMBER
=========================================
The INTERVAL parameter could be:
'trunc(sysdate)+1+9/24'
which should be interpreted as:
take todays date, put it back to midnight, add one day (tomorrow at midnight)
and then add 9 hours.
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-18-2004 12:01 AM
12-18-2004 12:01 AM
SolutionThe execution time for one execution are not in dba_jobs but in my opinion the best solution are that you create a metadate table to control your jobs, and at the begining and at the end of the procedure you must insrert the date of the jobs and all you want.
insert into my_control_table ('procedure_load','start',sysdate);
/**Execution job**/
insert into my_control_table ('procedure_load','end',sysdate);
Regards, Rolaher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
12-18-2004 05:58 AM
12-18-2004 05:58 AM
Re: How to get execution time for an specific job in dba_jobs?
You can also put something into the script like:
(At the start)
select sysdate into begintime from dual;
(At the end)
select sysdate into endtime from dual;
select round((endtime-begintime)*1440) into runtime from dual;
You could then insert it into a table without a problem.
Thanks,
Brian
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2021 Hewlett Packard Enterprise Development LP