SQL Clone
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
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1995 Visits: 1037
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
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2135 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
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1995 Visits: 1037
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
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1995 Visits: 1037
Guys please post your comments.

your help is highly awaited.
Mr. Kapsicum
Mr. Kapsicum
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1995 Visits: 1037
Is there anyone who can help me out.? Cool
anastke
anastke
SSC Veteran
SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)SSC Veteran (284 reputation)

Group: General Forum Members
Points: 284 Visits: 2354
anything in the logs?
RTaylor2208
RTaylor2208
SSCrazy
SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)SSCrazy (2.6K reputation)

Group: General Forum Members
Points: 2617 Visits: 1262
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
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2135 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
Ten Centuries
Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)Ten Centuries (1.2K reputation)

Group: General Forum Members
Points: 1237 Visits: 3038
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
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1995 Visits: 1037
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