You may watch the video here
https://www.youtube.com/watch?v=qrC-JhJqfRg
These queries can also be automated using Control-M database. Run these queries against enterprise manager database. I have tested it on postgres. You may need to change syntax a bit as per database.
1--> To check number of jobs loaded daily
select net_date, jobs from net_report;
2--> To check number of jobs executed today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
https://www.youtube.com/watch?v=qrC-JhJqfRg
These queries can also be automated using Control-M database. Run these queries against enterprise manager database. I have tested it on postgres. You may need to change syntax a bit as per database.
1--> To check number of jobs loaded daily
select net_date, jobs from net_report;
2--> To check number of jobs executed today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
3--> To check number of jobs executed between a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
4--> To check number of failed jobs today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
and ended_status=32
5--> To check number of failed jobs between a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=32
6--> To check number of jobs which completed successfully today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
and ended_status=16
7--> To check number of jobs which completed successfully between a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=16
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
4--> To check number of failed jobs today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
and ended_status=32
5--> To check number of failed jobs between a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=32
6--> To check number of jobs which completed successfully today
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time > Current_Date
and ended_status=16
7--> To check number of jobs which completed successfully between a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=16
8--> To check number of jobs which executed on a particular server in a time period
SELECT job_mem_name , sched_table as folder, application, start_time, end_time,
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status , node_id as Server
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=16 and node_id='<Server IP or Hostname>'
9--> To check count of jobs which ended ok and not ok today
select 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time > current_date
group by ended_status
union all
select 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time> current_date
group by ended_status
10--> To check count of success and failed jobs for a particular application folder
select * from
(
select 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59' and application like '%a%'
group by ended_status
union all
select 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59' and application like '%a%'
group by ended_status
) Table1
11--> To check count of success and failed jobs , application wise
select * from
(
select application, 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59'
group by application, ended_status
union all
select application, 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59'
group by application, ended_status
) Table1
order by 1
case when ended_status=16 then 'Ended OK' else 'Not Ok' end as Status , node_id as Server
from runinfo_history
where start_time between '2016-09-01 00:00:00' and '2016-09-10 23:59:59'
and ended_status=16 and node_id='<Server IP or Hostname>'
9--> To check count of jobs which ended ok and not ok today
select 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time > current_date
group by ended_status
union all
select 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time> current_date
group by ended_status
10--> To check count of success and failed jobs for a particular application folder
select * from
(
select 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59' and application like '%a%'
group by ended_status
union all
select 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59' and application like '%a%'
group by ended_status
) Table1
11--> To check count of success and failed jobs , application wise
select * from
(
select application, 'OK' Status, sum( case when ended_status=16 then 1 else 0 end) as Count from runinfo_history where ended_status=16
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59'
group by application, ended_status
union all
select application, 'Not OK' Status, sum( case when ended_status=32 then 1 else 0 end) as Count from runinfo_history where ended_status=32
and start_time Between '2016-09-01 00:00:00' and '2016-09-30 23:59:59'
group by application, ended_status
) Table1
order by 1
Thank you very much for the information Vikas :-)
ReplyDeleteThanks so much for those queries.
ReplyDeleteGreat to know that it is helpful. Please let me know if you need any other queries.
DeleteIs there any way to audit user actions done in the AJF, e.g. rerun/free etc.? I can't find the table that contains these records.
ReplyDeletePlease refer to audit_activities table.
DeleteAlso data in these tables will only be available if auditing is turned on. You can turn on auditing from configuration manager.
Just try a simple "select * from audit_actvities;" query and see the result.
Thank you for the queries!
ReplyDeleteIs there a way to have for a requested job the list of his "Waiting Info" ?
The goal is to know, at a certain time of the day, the list of jobs blocking the execution of the requested job.
Thanks a lot!
To fetch how all job details configured in a datacenter, with all its parameter
ReplyDeleteHow to get the list of of waiting jobs from AJF which are in hold state and doesn't have any waiting condition to meet.
ReplyDeleteHow to fetch the waiting info from AJF.
ReplyDeleteHello, please anyone know a query to have the list of jobs scheduled for a certain date?
ReplyDeleteI'm trying to do a report with job scheduled that have not run...
Thanks, Paolo.
I share the query on server db (ctrlmdb) for list jobs active that has not run (not 100% sure that is correct):
Deleteselect caj.* from cmr_ajf_jobs caj where caj.runcount = 0
VtempdaeZclav_na Joel Wisdom https://wakelet.com/wake/c7C-BfbcOGZLnXXSLeubh
ReplyDeletedionajssketim
Please provide me query to get the list of jobs on a specific date(probably old dates)
ReplyDeleteI need to know how many jobs loaded in AJF on a specific ODATE....it might be very old dates.around 200 days back ODATE.....can any one help me with query/somet way
ReplyDeleteNeed Query to get jobs under one connection profile in Control-M DB. Thanks in advance
ReplyDeleteCool and that i have a neat provide: Whole House Renovation Checklist Pdf home remodeling services
ReplyDelete