SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Who sent me this alert?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Hommer
Aged Yak Warrior

770 Posts

Posted - 04/01/2013 :  10:37:04  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
1600 Posts

Posted - 04/01/2013 :  17:41:12  Show Profile  Reply with Quote
Run this script to find which jobs are referencing the "DBCC" text string:
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
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

770 Posts

Posted - 04/02/2013 :  09:40:25  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000