Page 1 of 1

Statistical report

Posted: 02 Jan 2010 11:56
by maheshvenu
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

Posted: 03 Jan 2010 5:27
by Walty
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

Statistical report

Posted: 04 Jan 2010 6:30
by maheshvenu
Hi Walty,

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

Thanks and regards
MaheshVenu

Posted: 06 Jan 2010 11:46
by lahansen
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

Posted: 07 Jan 2010 1:47
by baralem
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

Posted: 13 Jan 2010 11:48
by lahansen
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

Posted: 13 Jan 2010 3:10
by baralem
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;

Posted: 14 Jan 2010 1:21
by baralem
I've made a correction to the previous query. I've tested it and it works OK.

regards.
martin.

Sysout error message

Posted: 25 Jan 2010 2:00
by gwr_d
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