Need to get a list of top 10 long running jobs

A lot of scripts ans example to extract information from Control-M tools.
Post Reply
User avatar
HeleneM
Nouveau
Nouveau
Posts: 1
Joined: 06 Mar 2013 12:00

Need to get a list of top 10 long running jobs

Post by HeleneM » 07 Mar 2013 3:25

Hi

we have recently upgraded Control-M to v7 with a postgres db.

I need a script to list out the top 10 long running jobs each day and also details of how to run it!

many thanks in advance

Helene

User avatar
fafa1975
Nouveau
Nouveau
Posts: 31
Joined: 18 Mar 2010 12:00

Query on database

Post by fafa1975 » 22 Mar 2013 11:46

Hi,
You can query the cmr_ajf table on the Control/M Server database.

SELECT applgroup,nodeid,memname,odate,startrun,endrun,jobname,applic, cast(endrun as bigint) - cast(startrun as bigint) as seconds_elapsed
FROM cmr_ajf order by seconds_elapsed desc LIMIT 10 ;

You can schedule the query just before the NDP and you have the top 10 long running jobs.

Hope it helps.

Fabrizio

User avatar
Dablu
Nouveau
Nouveau
Posts: 14
Joined: 12 Nov 2013 12:00

Re: Need to get a list of top 10 long running jobs

Post by Dablu » 30 Jun 2015 5:09

Thanks Fabrizio,
But can you let me know the same on pgsql DB and Control-M server is on windows.

Thanks for the update..

User avatar
Dablu
Nouveau
Nouveau
Posts: 14
Joined: 12 Nov 2013 12:00

Re: Need to get a list of top 10 long running jobs

Post by Dablu » 03 Jul 2015 5:19

fafa1975 wrote:Hi,

You can query the cmr_ajf table on the Control/M Server database.



SELECT applgroup,nodeid,memname,odate,startrun,endrun,jobname,applic, cast(endrun as bigint) - cast(startrun as bigint) as seconds_elapsed

FROM cmr_ajf order by seconds_elapsed desc LIMIT 10 ;



You can schedule the query just before the NDP and you have the top 10 long running jobs.



Hope it helps.



Fabrizio

Hi,

Can you help out how to set it up on Windows through a bat file with an automated mail
my Controm DB on default PGSQL
I did it on unix with oracel db , but having problem in above environment....

Thanks,
Dablu

Post Reply