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


Strange Working of Sql server database mail- Need urgent help


Strange Working of Sql server database mail- Need urgent help

Author
Message
Mr. Kapsicum
Mr. Kapsicum
Right there with Babe
Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)

Group: General Forum Members
Points: 772 Visits: 973
It may be a stupid question/problem,,, But i am struck up in a situation where i am not able to send emails from database email.

After much surfing on internet to find some solution, i came cross a script where it checks for the DB mail service status, if it is stopped, then again a script to start the service.
It is as Follows:

-- See if database mail (DM) is started
EXEC msdb.dbo.sysmail_help_status_sp ------- This Gives Output of STOPPED
GO

-- Stop the service
EXEC msdb.dbo.sysmail_stop_sp ---- This runs successfully.
GO

-- See if database mail (DM) is stopped
EXEC msdb.dbo.sysmail_help_status_sp ----- This Gives STOPPED (as expected)
GO

-- Start the service
EXEC msdb.dbo.sysmail_start_sp ---- This runs successfully.
GO



-- See if database mail (DM) is started
EXEC msdb.dbo.sysmail_help_status_sp ---- Now this executed just after the previous Query and give the
output as STARTED, but after few seconds when i
again execute this. output goes back to STOPPED

GO


Why does it STOPPED automatically when once it is started.
batgirl
batgirl
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1565 Visits: 1820
I had this issue some time ago and resolved by following the steps in http://technet.microsoft.com/en-us/library/ms190606(v=sql.105).aspx
Mr. Kapsicum
Mr. Kapsicum
Right there with Babe
Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)

Group: General Forum Members
Points: 772 Visits: 973
batgirl (9/11/2013)
I had this issue some time ago and resolved by following the steps in http://technet.microsoft.com/en-us/library/ms190606(v=sql.105).aspx


Thanks for the reply.
Will try the solution proposed by you.
but can u please explain me why this is happening.?
why database starts for few seconds and then it stops later.
Mr. Kapsicum
Mr. Kapsicum
Right there with Babe
Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)

Group: General Forum Members
Points: 772 Visits: 973
Guys please post your comments.

your help is highly awaited.
Mr. Kapsicum
Mr. Kapsicum
Right there with Babe
Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)

Group: General Forum Members
Points: 772 Visits: 973
Is there anyone who can help me out.? Cool
anastke
anastke
SSC-Enthusiastic
SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)SSC-Enthusiastic (182 reputation)

Group: General Forum Members
Points: 182 Visits: 2354
anything in the logs?
RTaylor2208
RTaylor2208
SSC-Addicted
SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)SSC-Addicted (488 reputation)

Group: General Forum Members
Points: 488 Visits: 1120
The mail agent only runs when it has emails to process, you can see that here:

select * from msdb.dbo.sysmail_log 



You can then check emails that were sent here:

select * from msdb.dbo.sysmail_mailitems



There are other mail tables that can be queried for profiles etc.

You can also check that database mail is enabled with this:

sp_configure 'Database Mail XPs'



MCITP SQL 2005, MCSA SQL 2012
batgirl
batgirl
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1565 Visits: 1820
Mr. Kapsicum (9/11/2013)
batgirl (9/11/2013)
I had this issue some time ago and resolved by following the steps in http://technet.microsoft.com/en-us/library/ms190606(v=sql.105).aspx


Thanks for the reply.
Will try the solution proposed by you.
but can u please explain me why this is happening.?
why database starts for few seconds and then it stops later.


I can only guess that the configuration was not done properly until I followed the document. After changing the e-mail system, you must restart the SQL Server Agent service for the change to take effect.
LightVader
LightVader
SSC Eights!
SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)SSC Eights! (825 reputation)

Group: General Forum Members
Points: 825 Visits: 2893
On a few of my instances, I've increased the Database Mail Executable Minimum Lifetime (seconds) from 500 to 43200. You can find that by risk-clicking on database mail --> Configure Database Mail --> View or Change system parameters.

I don't remember exactly where that number came from, but I was having a similar issue where when I wanted to send out an email via database mail, like when a job failed, it was always stopped.



The opinions expressed herein are strictly personal and do not necessarily reflect the views or policies of my employer.
Mr. Kapsicum
Mr. Kapsicum
Right there with Babe
Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)Right there with Babe (772 reputation)

Group: General Forum Members
Points: 772 Visits: 973
Thanks for the suggestions. Guys.


But problem is solved.

Just Upgraded SP 1 to SP 2. :-D:-D
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