Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Who sent me this alert?

Author  Topic 

Hommer
Aged Yak Warrior

808 Posts

Posted - 2013-04-01 : 10:37:04
Hey, my dear experts,

I am chasing my own tail. Now I ask your help.

I am getting this email alert telling me my DBCC job failed. Most likely I am the one who set that up.

The problem is that I couldn't find this phantom "failing" job in the job history log or any other logs. Neither in any maint plan under design view.

All I found is several rows from msdb:

Select * from dbo.sysmail_mailitems where subject ='DBCC job failed'.

So what process fired it off?

Thanks!

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2013-04-01 : 17:41:12
Run this script to find which jobs are referencing the "DBCC" text string:[CODE]set NoCount ON
set DateFirst 7 -- 7 (Default) ==> Sunday is the first day of the week
--select DatePart(WeekDay, GetDate())

declare
@match nvarchar(max),
@delta int

select @match = N'DBCC'

select
@@SERVERNAME Server,
j.name job_name,
js.step_id,
js.step_name,
js.command
from
msdb.dbo.sysjobs j
inner join msdb.dbo.sysjobsteps js
on js.job_id = j.job_id
where
js.command like N'%' + @match + N'%'
or js.step_name like N'%' + @match + N'%'
or j.name like N'%' + @match + N'%'
order by
job_name,
step_id[/CODE]If you can find the code that's running, perhaps you can correlate the job execution time and the email sent time.

=================================================
There are two kinds of light -- the glow that illuminates, and the glare that obscures. -James Thurber
Go to Top of Page

Hommer
Aged Yak Warrior

808 Posts

Posted - 2013-04-02 : 09:40:25
Great! That helped me narrow down to this one job.

However, the view history shows this job has been running successfully at 2AM and the notifications setting is to email me then the job fails.

And, my emails I got were at 12:02 AM. Wired.

I am going to just turn off the notifications this weekend.

Thanks!
Go to Top of Page
   

- Advertisement -