Linux 上的 MSSQL: 資料庫複本角色已變更

Microsoft.SQLServer.Linux.EventRule.DatabaseReplica.RoleChanged (Rule)

資料庫複本變更其角色時會發生此錯誤。

Knowledge Base article:

摘要

資料庫複本變更其角色時會發生此錯誤。

在 SQL Server 中,預設會停用此事件。透過下列 TSQL 即可啟用: sp_altermessage 1480, 'with_log', 'true'

原因

請檢查事件描述中的原因。

解決方式

使用者無須採取任何動作。如需詳細資訊,請參閱 SQL Server 錯誤記錄檔、Linux Server 容錯移轉叢集 (WSFC) 管理主控台或 WSFC 記錄檔。

可覆寫的參數

名稱

描述

預設值

已啟用

啟用或停用該工作流程。

間隔 (秒)

每次重複執行工作流程之間的時間間隔 (秒)。

300

優先順序

定義警示優先順序。

1

嚴重性

定義警示嚴重性。

1

同步處理時間

同步處理時間

 

逾時 (秒)

指定流程被關閉及標示為失敗之前,允許執行的時間。

200

資料庫連線的逾時 (秒)

若工作流程無法在指定的期限之內存取資料庫,將會失敗並登錄一則事件。

15

Element properties:

TargetMicrosoft.SQLServer.Linux.DatabaseReplica
CategoryEventCollection
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
RemotableTrue
Alert Message
Linux 上的 MSSQL: 資料庫複本角色已變更
{0}

Member Modules:

ID Module Type TypeId RunAs 
_F6DA1507_12AF_11D3_AB21_00A0C98620CE_ DataSource Microsoft.SQLServer.Linux.DataSource.EventReaderSingleParam Default
GenerateAlert WriteAction System.Health.GenerateAlert Default

Source Code:

<Rule ID="Microsoft.SQLServer.Linux.EventRule.DatabaseReplica.RoleChanged" Target="SqlDiscL!Microsoft.SQLServer.Linux.DatabaseReplica" Enabled="true" ConfirmDelivery="true" Remotable="true">
<Category>EventCollection</Category>
<DataSources>
<DataSource ID="_F6DA1507_12AF_11D3_AB21_00A0C98620CE_" Comment="{F6DA1507-12AF-11D3-AB21-00A0C98620CE}" TypeID="Microsoft.SQLServer.Linux.DataSource.EventReaderSingleParam">
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</InstanceName>
<ConnectionString>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/ConnectionString$</ConnectionString>
<InstanceVersion>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Version$</InstanceVersion>
<InstanceEdition>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/Edition$</InstanceEdition>
<FilterMsg>The availability group database "</FilterMsg>
<ParamRegex>^The availability group (database ".*") is changing roles from "[^"]+" to "[^"]+" because the mirroring session or availability group failed over due to [^"]+\. This is an informational message only\. No user action is required\.$</ParamRegex>
<TargetKey>database "$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DatabaseReplica"]/AvailabilityDatabaseName$"</TargetKey>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>200</TimeoutSeconds>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="GenerateAlert" TypeID="Health!System.Health.GenerateAlert">
<Priority>1</Priority>
<Severity>1</Severity>
<AlertMessageId>$MPElement[Name="Microsoft.SQLServer.Linux.EventRule.DatabaseReplica.RoleChanged.AlertMessage"]$</AlertMessageId>
<AlertParameters>
<AlertParameter1>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</AlertParameter1>
<AlertParameter2>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/InstanceName$</AlertParameter2>
<AlertParameter3>Event ID: 1480. $Data/Property[@Name='Message']$</AlertParameter3>
</AlertParameters>
<Suppression>
<SuppressionValue/>
</Suppression>
</WriteAction>
</WriteActions>
</Rule>