It is currently 16 Aug 2018 12:18


Post new topic  Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Statistical report
PostPosted: 02 Jan 2010 11:56 
Hi,
we need to get statistical report for set of jobs for every month. we used ctmstats utility to generate the report but the problem we are facing is that job names get truncated during the output.

Also we tried to extract through SQL query from the table CMR_RUNINF but again we are facing the following problem

1. We are not able to get the correct CPU_TIME and Elapsed time since both the fields are in number data type.

Can anyone advise on the issue, also let me know how the conversion is made from time to number datatype.


Thanks and regards
MaheshVenu


Top
   
 Post subject:
PostPosted: 03 Jan 2010 5:27 
Offline
Nouveau
Nouveau
User avatar

Joined: 20 Jan 2006 12:00
Posts: 473
Hi,

an example used for a similar situation:

select JOBNAME
, nodeid
, to_char(to_timestamp(trim(timestmp)
, 'YYYYMMDDHH24MISS') - numtodsinterval(elaptime / 100
, 'SECOND'), 'YYYY-MM-DD HH24:MI:SS') as start_time
, to_char(to_date(trim(timestmp), 'YYYYMMDDHH24MISS')
, 'YYYY-MM-DD HH24:MI:SS') as end_time
, substr(to_char(numtodsinterval(elaptime / 100, 'SECOND')
, 'HH24:MI'), 12, 8) as duration
from CMR_RUNINF where CMR_RUNINF.JOBNAME
like 'your_jobname'
order by jobname, start_time

_________________
Best regards
Walty


Top
   
 Post subject: Statistical report
PostPosted: 04 Jan 2010 6:30 
Hi Walty,

Thanks a lot and the output is so precise...
great..

Thanks and regards
MaheshVenu


Top
   
 Post subject:
PostPosted: 06 Jan 2010 11:46 
Offline
Nouveau
Nouveau
User avatar

Joined: 07 Nov 2006 12:00
Posts: 4
Location: DK
Hi Walty,

yes - great.

Could you help me with adding another field too.

I would like to have data with "Avarage Elapsed time"
extracted within the same SQL.

Is that possible?

--
Lars


Top
   
 Post subject:
PostPosted: 07 Jan 2010 1:47 
You can obtain average elapsed time but not in the same query because it is a summarized value. If you add another field in select list you also must add it in group by clause.

select JOBNAME , SCHEDTAB, substr(to_char(numtodsinterval(AVG(elaptime) / 100, 'SECOND') , 'HH24:MI'), 12, 8 ) as duration
from CMR_RUNINF
where CMR_RUNINF.JOBNAME = 'your_jobname'
group by JOBNAME, SCHEDTAB
order by schedtab, jobname;

regards
martin


Top
   
 Post subject:
PostPosted: 13 Jan 2010 11:48 
Offline
Nouveau
Nouveau
User avatar

Joined: 07 Nov 2006 12:00
Posts: 4
Location: DK
Thanks,

as you problerly can see I am not a advanced SQL user.

Is'nt posible to combine the two SQL's so that I can have
a output that looks like this:

JOBNAME START_TIME END_TIME DURATION AVARAGE

Br.
Lars Hansen


Top
   
 Post subject:
PostPosted: 13 Jan 2010 3:10 
AVG is a group function. It means that has to be applied to a group of rows. If you need average time for each job then you have to group the row by jobname. If you check the statistics for a job the AVERAGE times are separated of job execution statistics because there are calculated using job's execution info.
I believe that it is possible to create a view that returns average execution time for each job and then join the view with the other query but average time will be the same for all the rows with the same jobname. Try something like this:

--CREATE VIEW
create view jobs_avg_time as
select JOBNAME , NODEID, substr(to_char(numtodsinterval(AVG(elaptime) / 100, 'SECOND') , 'HH24:MI'), 12, 8 ) as duration
from CMR_RUNINF
group by JOBNAME, NODEID;

--RUNINF query
select CMR_RUNINF.JOBNAME
, CMR_RUNINF.nodeid
, to_char(to_timestamp(trim(timestmp)
, 'YYYYMMDDHH24MISS') - numtodsinterval(elaptime / 100
, 'SECOND'), 'YYYY-MM-DD HH24:MI:SS') as start_time
, to_char(to_date(trim(timestmp), 'YYYYMMDDHH24MISS')
, 'YYYY-MM-DD HH24:MI:SS') as end_time
, substr(to_char(numtodsinterval(elaptime / 100, 'SECOND')
, 'HH24:MI'), 12, 8 ) as duration
, jobs_avg_time.duration as avg_duration
from CMR_RUNINF, jobs_avg_time
where CMR_RUNINF.jobname=jobs_avg_time.jobname
and CMR_RUNINF.nodeid=jobs_avg_time.nodeid
order by jobname, start_time;


Top
   
 Post subject:
PostPosted: 14 Jan 2010 1:21 
I've made a correction to the previous query. I've tested it and it works OK.

regards.
martin.


Top
   
 Post subject: Sysout error message
PostPosted: 25 Jan 2010 2:00 
Offline
Nouveau
Nouveau
User avatar

Joined: 25 Jan 2010 12:00
Posts: 12
Hi All,

I wanted to report the sysout error message like " Unable to connect to Oracle"
Pls let me know where the sysout details are stored


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited
The site created by Franck YOT. Images, logo, content and trademarks about Control-M products are property of BMC Software.
All the comments are property of their posters. Images, logo, content and design are © copyright by Scheduler-Usage.com. All Rights Reserved