积极答复者
如何清除SQL 2005 数据库邮件队列中信息?

问题
答案
全部回复
-
这样检查过了吗?“ sysmail_event_log” 和“Windows 应用程序事件日志”是否有相关信息。如果没有请参照下面的网址解决:
http://msdn.microsoft.com/zh-cn/library/ms189959.aspx -
查过sysmail_event_log 和Windows 应用程序事件日志,都有下面的错误提示(以前正常,出现下面错误后就不能发邮件了,后来更换了服务器,正常了两天,也出现这种错误提示,接着也不能发邮件了):
1) Exception Information
===================
Exception Type: Microsoft.SqlServer.Management.SqlIMail.Server.Common.BaseException
Message: There was an error on the connection. Reason: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached., connection parameters: Server Name: DB02, Database Name: msdb
Data: System.Collections.ListDictionaryInternal
TargetSite: Void OpenConnection(Microsoft.SqlServer.Management.Common.SqlConnectionInfo)
HelpLink: NULL
Source: DatabaseMailEngineStackTrace Information
===================
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.OpenConnection(SqlConnectionInfo ci)
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.DataAccessAdapter.OpenConnection(String dbServerName, String dbName, String userName, String password)
at Microsoft.SqlServer.Management.SqlIMail.IMailProcess.QueueItemProcesser.ProcessQueueItems(String dbName, String dbServerName, Int32 lifetimeMinimumSec, LogLevel loggingLevel)2) Exception Information
===================
Exception Type: System.InvalidOperationException
Message: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
Data: System.Collections.ListDictionaryInternal
TargetSite: System.Data.ProviderBase.DbConnectionInternal GetConnection(System.Data.Common.DbConnection)
HelpLink: NULL
Source: System.DataStackTrace Information
===================
at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.SqlClient.SqlConnection.Open()
at Microsoft.SqlServer.Management.SqlIMail.Server.DataAccess.ConnectionManager.OpenConnection(SqlConnectionInfo ci) -
已参考http://msdn.microsoft.com/zh-cn/library/ms189959.aspx
SELECT is_broker_enabled FROM sys.databases WHERE name = 'msdb'; 返回1
EXECUTE dbo.sysmail_start_sp 可以启动服务
但执行EXECUTE dbo.sysmail_help_status_sp, 状态始终是inactive -