Rodney

SQL Server Secret Agent Holds its Secret as to Why It Won't Start

Published Thursday, March 01, 2007 10:22 PM

SQL Server Agent and SQL Mail for SQL 2000 Server requires a MAPI client (out of the box) to begin with -- a simple, yet unavoidable fact. MAPI, for those who like to time travel is the Messaging Application Programming Interface. To send notifications with SQL 2000, say when a SQL Server (Secret) Agent job fails,  the service account must have access to a MAPI client, or a mail profile to be precise. The mail profile is created with a MAPI client (Outlook or Outlook Express). MAPI, which is an MS beast that adheres to the "Embrace, extend and exterminate" practice of developing proprietary code. I won't go into that further but will say, MAPI, like TAPI (Telephony Application Programming Interface) and SAPI (Speech fill out the rest) is something that will not lay over and die.  Thankfully SQL Server 2005 embraces a fully compliant SMTP interface in Database Mail (death to SQL Mail). At any rate, inheritance being what it is, the marriage of the SQL Server Agent and MAPI was one that brought a bit of frustration today. If you ever stop and attempt to restart the SQL Server Agent to get the notifactions to work (especially on Windows 2000) beware.  And I would recommend to not set the SQLServerAgent service to restart if it stops unexpectedly.

I say all of this because today I could not start the SQL Agent Service at all. It timed out every time, could not / would not with a house, start. I used "SQLServerAgent -c -v "to try start is outside of the service and recieved an error regarding a failed login to the MAPI client. I had to use Task Manager to KILL the sqlagent process many times.  Service account was good, with all permissions to log files and registry. Rebuilding the profile and "ugg" Personal Folders for the mail profile did nothing.

So...is it true..dare I say..dare I? When in doubt...reboo...

no I can't say it.

But alas, a scheduled reboot cured ALL ails. Sql Server Secret Agent started as if it had not pissed me off all afternoon with it's inability to fire off from Service Manger, Enterprise Manager and command line.

Here is my advice if you find yourself with a Windows 2000 \ SQL Server 2000 \ SQL Server Agent that will not start. Tell your IT team (assuming you are not the IT team) you need to schedule a reboot for late in the evening, go home, get a glass of wine or a 6 pack and wait for the expected success after said reboot.  Don't waste time, as I did, dorking around with MAPI, registry, file permissions, log files, event logs, SQL Server logs, RDP, and command lines. Get the Hell out and look for the power button.

by Rodney

Comments

 

David R Buckingham said:

It won't succeed until you can clear out all the MAPI32.EXE processes.  If SQL Server has not made use of MAPI (and only SQL Server Agent service), then you should be able to kill any/all of them through Task Manager.  However, if SQL Server has accessed the MAPI interface, then you will at minimum have to stop the SQL Server service, then kill all the MAPI32.EXE processes.

Once they're all dead, the SQL Server and SQL Server Agent services should start up clean and notifications will flow as expected.  It was for that reason I stopped using SQL Mail from SQL Server and only used it from SQL Server Agent --- so that I could just stop the Agent service, kill the MAPI32.EXE processes, and restart the Agent service --- without having to stop/start the SQL Server service and incur downtime.

For sending mail from SQL Server, I made use of a 3rd party extended stored procedure that was a pure SMTP solution (however, it did not work with SQL Server Agent of course).
March 2, 2007 1:03 PM
 

blackberry download free ringtones said:

As a summary of <a href=http://www.genebase.com/node/P3905073/blogIndex.php?blogId=156416>100 free mobile ringtones virgin</a> <a href=http://taletta6186.blogr.com/stories/8022298/>free nokia 1100 ringtones</a>
February 4, 2008 12:06 PM
 

free i730 motorola nextel ringtones said:

Any kind of <a href=http://taletta6186.blogr.com/stories/8022308/>complimentary music real ringtones</a> <a href=http://taletta6186.blogr.com/stories/8022316/>free ringtones maker software</a>
February 4, 2008 12:33 PM
You need to sign in to comment on this blog

















<March 2007>
SuMoTuWeThFrSa
25262728123
45678910
11121314151617
18192021222324
25262728293031
1234567
Creating Technical Presentations
 Making a technical presentation is like being interviewed. It is not a skill that you are likely to... Read more...

Go With the Flow
 Knowing enough about the routes that messages take is vital to being an effective Exchange admin,... Read more...

Policy-Based Management
 Every DBA knows the frustration of trying to manage tens of servers, each of which has a subtly... Read more...

When Email Collaboration Could Have Changed History
 In our mission to make history relevant to the busy IT executive, we speculate how Email might have... Read more...

Bunnikins!
 When an IT manager is selected as a victim of office politics of a large corporate, it is time for him... Read more...