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
 finding orphan SQL notification

Author  Topic 

Hommer
Aged Yak Warrior

808 Posts

Posted - 2014-01-16 : 10:44:00
Hi,
I need some help on finding the process that sending me this phantom/orphan SQL notification email.
It was created by me, most likely through a Maintenance Plan or Agent Job awhile back.
I also could see them in msdb sysmail_sentitems system view.
However, I couldn’t nail it down in order to turn it off.
Here is the detail of the email, but I did not find any failed job in history or any logs.
And this is SQL 2008 R2. Thanks!

----
From: Me
To: myself
Subject: OurApp Weekly DBCC Failure
Message: OurApp Weekly DBCC Failure Check Logs
Sent: every Sun 12:00 AM
----

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2014-01-16 : 12:22:16
Does the agent job history give you any indication? Looking at the jobs that are scheduled to run on Sundays at 12:00 AM perhaps would point you in the righ tdirection.
Go to Top of Page

Hommer
Aged Yak Warrior

808 Posts

Posted - 2014-01-17 : 09:08:55
I found 2 agent jobs @12.

But they did not fail, and don't have steps running DBCC, and most importantly do not have alert/notification as I have described.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2014-01-20 : 08:53:11
SQL Agent and SQL Log files any help (what do they have recorded for Sun 12:00 am)?

I doubt SQL Agent log file will help, from memory it only records things that go wrong, but SQL Log often records successful actions too - might just show up something <FingersCrossed!>

Is there a way to interrogate MSDB to find what things could issue a schedule at Midnight? That might point to a schedule, and from there a task associated with it, which is outside the scope of normal jobs perhaps??

You sure you are looking at the right server? {;)]
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2014-01-21 : 19:05:13
I haven't used this is quite a while but it might lead you to the source (it's supposed to find a string within the jobs):[CODE]use MSDB;

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'OurApp Weekly DBCC Failure' --<< << << CHANGE THIS AS DESIRED !!!

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]

=================================================
A man is not old until regrets take the place of dreams. - John Barrymore
Go to Top of Page

Hommer
Aged Yak Warrior

808 Posts

Posted - 2014-01-28 : 14:17:12
Thank you for all the replies!

Sorry for the late reply.

As you may have imagined, the issue is bugging me, but it is not a high priority item on my list.

I tried everything suggested here, including digging around other servers that have the same app, and running the script Bustaz Kool's posted, but found nothing.

I even created an outlook auto process rule to put the weekly notifications into a deleted folder, (hiding them under the carpet:).
Go to Top of Page
   

- Advertisement -