Hi,
I'm using a test server for training. A few days ago I did some tests with backup/restore/rebuild of the system databases, everything worked fine, or at least it seemed having worked fine.
Now I'm doing some tests with database mail and several problems appeared.
First, I received an error message from database mail wizard and I solved with this statement:
ALTER DATABASE msdb SET NEW_BROKER WITH ROLLBACK IMMEDIATE
Next I saw error messages in the log about the user ##MS_PolicyEventProcessingLogin##. At this point I realized this was the result of my previous tests with the system databases. I solved the problem with this statement in the master and MSDB:
exec sp_change_users_login 'Auto_Fix', '##MS_PolicyEventProcessingLogin##',
NULL
Event after these corrections, database mail doesn't start, I mean, I can't see the start message in the log. All the mail messages stay in the queue, I can see the messages in the queue using one of these statements:
select * from msdb..sysmail_allitems
SELECT * FROM ExternalMailQueue
I can see the mail queue status as inactive using the following statement:
msdb..sysmail_help_queue_sp @queue_type = 'Mail'
I already tried to start/stop the database mail in MSDB with the following statements:
EXEC msdb.dbo.sysmail_stop_sp;
EXEC msdb.dbo.sysmail_start_sp;
In the middle of all these tests I already deleted the messages in the queue using
msdb.dbo.sysmail_delete_mailitems_sp @sent_status='unsent'
I also restarted the SQL Server service and SQL Server agent service several times.
I have no idea what else I can try to start database mail.
Thank you for any help !
Dennes [http://bufaloinfo.cloudapp.net] Inscreva-se em meu treinamento on-line de T-SQL - [http://bufaloinfo.cloudapp.net/Cursos/linguagemsql.aspx]