Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

DBMail service stopped - Job notification sent Expand / Collapse
Author
Message
Posted Thursday, February 28, 2013 12:45 PM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 1:49 PM
Points: 65, Visits: 590
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.
Post #1425259
Posted Thursday, February 28, 2013 1:30 PM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 2:29 PM
Points: 541, Visits: 1,050
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.
Post #1425269
Posted Friday, March 1, 2013 7:04 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Today @ 1:49 PM
Points: 65, Visits: 590
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.
Post #1425496
Posted Friday, March 1, 2013 1:51 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 2:13 PM
Points: 1,889, Visits: 2,036
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
Post #1425726
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse