Availability Database Join State

Microsoft.SQLServer.2016.AlwaysOn.DbrJoinState (UnitMonitor)

This monitor checks the join state of database replica. The monitor is unhealthy when the database replica is not joined. The monitor is in healthy state otherwise.

Knowledge Base article:

Summary

This monitor checks the join state of database replica. The monitor is unhealthy when the database replica is not joined. The monitor is healthy otherwise.

Causes

This secondary database is not joined to the availability group. The configuration of this secondary database is incomplete.

Resolutions

Join the database replica using T-SQL, SQLPS cmdlet or SSMS UI.

Overrideable Parameters

Name

Description

Default Value

Enabled

Enables or disables the workflow.

Yes

Generates Alerts

Defines whether the workflow generates an Alert.

No

Interval (seconds)

The recurring interval of time in seconds in which to run the workflow.

900

Timeout (seconds)

Specifies the time the workflow is allowed to run before being closed and marked as failed.

300

Element properties:

TargetMicrosoft.SQLServer.2016.AlwaysOn.DatabaseReplica
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveFalse
Monitor TypeMicrosoft.SQLServer.2016.AlwaysOn.SystemPolicyScriptMonitorType
RemotableTrue
AccessibilityPublic
RunAsMicrosoft.SQLServer.MonitoringAccount

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.2016.AlwaysOn.DbrJoinState" RunAs="GPMP!Microsoft.SQLServer.MonitoringAccount" TypeID="Microsoft.SQLServer.2016.AlwaysOn.SystemPolicyScriptMonitorType" Accessibility="Public" Enabled="true" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Target="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.DatabaseReplica" Priority="Normal">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<Interval>900</Interval>
<TimeoutSeconds>300</TimeoutSeconds>
<PolicyName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.DatabaseReplica"]/AvailabilityGroupName$-$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.DatabaseReplica"]/Name$-AlwaysOnDbrJoinStatePolicy</PolicyName>
<InstanceName>$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2016.AlwaysOn.DatabaseReplica"]/AvailabilityReplicaServerName$</InstanceName>
</Configuration>
</UnitMonitor>