Service Broker/資料庫鏡像傳輸無法在連接埠上接聽,因為該連接埠正在使用

Microsoft.SQLServer.2008.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule (Rule)

Knowledge Base article:

摘要

建立 Service Broker 或資料庫鏡像端點時,SQL Server 會接受端點指定的連接埠上的 TCP/IP 連線。傳輸安全性須具備連接埠的連線授權。如果執行 SQL Server 的電腦上已啟用防火牆,則該電腦上的防火牆組態必須允許在端點所指定的連接埠上進行傳入及傳出連線。

在此情形中,由於指定連接埠已被佔用,故無法使用。

原因

電腦上的另一個程式正在使用指定的 TCP 通訊埠。Windows 應用程式記錄檔中將會指出 Service Broker 或資料庫鏡像是否記錄該錯誤。此訊息在 Windows 應用程式記錄檔中記錄為 MSSQLSERVER 事件識別碼 9692。

解決方式

在命令提示字元下,執行 netstat -aon,以判定正在使用該連接埠的程式為何。

您可以停用使用該連接埠的應用程式,或在 Service Broker 應用程式中指定不同的連接埠。

外部資源

請參閱《SQL Server 2008 線上叢書》中的<ALTER ENDPOINT (Transact-SQL)>。

Element properties:

TargetMicrosoft.SQLServer.2008.DBEngine
CategoryEventCollection
EnabledTrue
Event_ID9692
Event Source$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$
Alert GenerateTrue
Alert SeverityError
Alert PriorityNormal
RemotableTrue
Alert Message
Service Broker/資料庫鏡像傳輸無法在連接埠上接聽,因為該連接埠正在使用
{0}
Event LogApplication
CommentMom2008ID='{BEE972D8-4422-4CFD-BC7D-B1035EA67E9D}';MOM2008GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.Windows.EventProvider Microsoft.SQLServer.SQLDefaultAccount
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.2008.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule" Target="SQL2008Core!Microsoft.SQLServer.2008.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2008ID='{BEE972D8-4422-4CFD-BC7D-B1035EA67E9D}';MOM2008GroupID={467ECC75-C5DA-42BD-955C-A73BBB51AF74}">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Windows!Microsoft.Windows.EventProvider" RunAs="SQL!Microsoft.SQLServer.SQLDefaultAccount">
<ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<LogName>Application</LogName>
<Expression>
<And>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>EventDisplayNumber</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>9692</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
<Expression>
<SimpleExpression>
<ValueExpression>
<XPathQuery>PublisherName</XPathQuery>
</ValueExpression>
<Operator>Equal</Operator>
<ValueExpression>
<Value>$Target/Property[Type="SQL!Microsoft.SQLServer.DBEngine"]/ServiceName$</Value>
</ValueExpression>
</SimpleExpression>
</Expression>
</And>
</Expression>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="SystemHealth!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>2</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.2008.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>