Posted - 01/02/2014 : 07:15:58
| "An attempt was made to send an email when no email session has been established"
Set up database mail, did a test email, I am ALMOST certain that I built a scheduled job (which returned error) and proved that that would send an Email. All my tests worked.
Backups failed on Christmas Eve (disk full). I didn't get any emails. They've been failing for 8 days over the holiday break (users shouting on return to work this morning was the first alert I got).
I've googled. The advice seems to be "Restart SQL Agent" plus variations of "Delete the profile and remake it"
I can do that (need scheduled downtime for the SQL Agent restart, so will have to be tonight).
Are there alternative fixes/ tests that I should be looking at?
Let's assume that will fix it. How can I rely on Database Mail not failing in the future? I don't really want everything emailing me on SUCCESS, I get enough alerting emails as it is ... and I'll miss the one critical Email a month warning me of Failure
Last time I had to seriously monitor some systems I build a script that took all the logs that were supposed to exist, stripped from them all the known-good-success-messages, and then emailed me whatever was left. Thus I got one email a day telling me that every expected log existed, and including any messages that were NOT expected. Failure of that, one, email to arrive was an alert that the reporting system had failed. The Email was quick to scan to see if there were any GotChas.
Perhaps I need to find the code for that and resurrect it if I cannot rely on SQL to reliably email me on failure?