Hi,
i converted our dbms_job - jobs to the newer package dbms_scheduler.
It is a 10.2.0.4 patch 23(8609347) database on an windows server 2003 R2 Enterprise x64 Edition SP2.
The Jobs(about 130) are nothing special ... only some statistics, matview-refreshes and so on.
For the notification of failed jobs and jobs which run over the max_run_duration i downloaded and installed the job notification package.
The jobs are assigned to different departments and the corresponding developer teams in our company.
I created a notification job for each department and if a job fails we (the database administrators) and the corresponding deverlopers will be informed.
Now i ascertained that only 1 email will be send if 2 jobs of the same department fails at the same time.
The emailer-jobs are auto-generated by the job notification package. I only modified them to look after all jobs of special department and not only after one job. (--> event_condition ... object_name LIKE 'XXX%')
example for dba-jobs(copy of the script output of TOAD):
SYS.DBMS_SCHEDULER.CREATE_JOB
(
job_name => 'DBA_JOBS_EMAILER'
,start_date => NULL
,event_condition => tab.user_data.object_name LIKE ''DBA%'' AND tab.user_data.event_type in (''JOB_FAILED'',''JOB_OVER_MAX_DUR'')'
,queue_spec => 'SYS.SCHEDULER$_EVENT_QUEUE, JOB_FAILED_AGENT'
,end_date => NULL
,program_name => 'SYS.EMAIL_NOTIFICATION_PROGRAM'
,comments => 'Auto-generated job to send email alerts for jobs "DBA%"'
);
I thought that a queue is used to manage all events from the scheduler jobs. So i made a test with 2 dba jobs and simulated a failure at the same time but i received only one mail.
So what is happend with the second event? I looked for the events in the qtab(SCHEDULER$_EVENT_QTAB) which belongs to the event queue(SYS.SCHEDULER$_EVENT_QUEUE) and no event was missing.
So i think the emailer job has to run 2 times.
Is anyone able to explain or to find my mistake?
I know that the easiest way is to create one emailer job for each normal job but i think this is a little bit costly because all the arguments are the same for one department.
Thanks & Regards