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

Microsoft.SQLServer.2014.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule (Rule)

建立 Service Broker 或資料庫鏡像端點時,SQL Server 應可接受端點組態中所指定連接埠上的 TCP/IP 連接。傳輸安全性需要與連接埠相連接的授權。如果伺服器啟用了防火牆,則防火牆組態必須允許端點所使用連接埠的傳入和傳出連線。

Knowledge Base article:

摘要

建立 Service Broker 或資料庫鏡像端點時,SQL Server 應可接受端點組態中所指定連接埠上的 TCP/IP 連接。傳輸安全性需要與連接埠相連接的授權。如果伺服器啟用了防火牆,則防火牆組態必須允許端點所使用連接埠的傳入和傳出連線。

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

原因

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

解決方式

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

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

外部資源

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

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

2

Element properties:

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

Member Modules:

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

Source Code:

<Rule ID="Microsoft.SQLServer.2014.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule" Target="SQL2014Core!Microsoft.SQLServer.2014.DBEngine" Enabled="true" ConfirmDelivery="true" Remotable="true" Comment="Mom2014ID='{BEE972D8-4422-4CFD-BC7D-B1035EA67E9D}';MOM2014GroupID={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">
<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="SQL2014Core!Microsoft.SQLServer.2014.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.2014.The_Service_Broker_Database_Mirroring_transport_cannot_listen_on_port_because_it_is_in_use_5_Rule.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>Event ID: $Data/EventDisplayNumber$. $Data/EventDescription$</AlertParameter1>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>