Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


DBMail service stopped - Job notification sent


DBMail service stopped - Job notification sent

Author
Message
jralston88
jralston88
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 689
DBMail was installed on a 2008 SQL Server platform. Profile, alerts and job monitoring were setup. Due to other environment problems - all alerts and job monitoring were disabled. We had other issues which would have sent 50-100 emails a day (I had a few hours of that).

Once these issues were resolved, alerts and job monitoring were re-enabled - then bounced the SQL Server agent. Sending a test DB mail failed (Error: 14641 - Database Mail is stopped). Running sysmail_help_status_sp showed the DBMail was stopped.

While researching (I decided not to run sysmail_start_sp initially), I noticed 2 job notification emails sent well after bouncing the SQL agent (two days later). Running sysmail_help_status_sp yielded the same - dbmail was still stopped.

My question - how is it that DBMail service appears stopped yet DBMails are generated? Comments / URLs are appreciated.

Thank you.
Erin Ramsay
Erin Ramsay
Mr or Mrs. 500
Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)Mr or Mrs. 500 (561 reputation)

Group: General Forum Members
Points: 561 Visits: 1099
If I remember correctly, DBMail is the service which actually sends the email but is NOT the service the queues them up to be sent so SQL Server will queue up the email, find that it can't send it and then move it to sysmail_unsentitems and a number of the other sysmail tables for reporting purposes.
jralston88
jralston88
SSC Journeyman
SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)SSC Journeyman (77 reputation)

Group: General Forum Members
Points: 77 Visits: 689
Erin,
Thank you for responding. I believe you are correct that DBMail is the service which actually sends the email.

Running msdb.dbo.sysmail_help_status_sp tell me the status of DBMail. It tells me its stopped. Attempting to send a test email fails - indicating the service is stopped. My question - how am I receiving emails?

Any comments / URLs are appreciated - thank you.
Chris Harshman
Chris Harshman
SSCrazy
SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)SSCrazy (2.7K reputation)

Group: General Forum Members
Points: 2687 Visits: 3289
Database Mail in SQL Server uses the Service Broker functionality. As mentioned before, the sp_send_dbmail command just queues up messages. As part of the service broker functionality, when an item is added to the queue, an activation procedure runs that ensures the external DB Mail program is running. You can see this process just like any other process running on your database:
select * from sys.dm_exec_sessions where program_name like 'DatabaseMail%'


When it is running, you'll probably see it wating with the wait type BROKER_RECEIVE_WAITFOR. It will naturally stop itself after a certain period of inactivity, don't remember exactly how long. But a new item put in the queue will ensure it starts up again.

Probably the best online documentation I've seen for it is:
http://www.yaldex.com/sql_server_tutorial_3/ch10lev1sec2.html

Here's the basic MSDN documentation which doesn't mention much about the service broker part of it:
http://msdn.microsoft.com/en-us/library/ms175887(v=SQL.105).aspx
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search