Availability Database Join State

Microsoft.SQLServer.Windows.Monitor.DatabaseReplica.JoinState (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.

Overridable 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

Synchronization Time

The synchronization time specified by using a 24-hour format. May be omitted.

 

Timeout (seconds)

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

300

Timeout for database connection (seconds)

The workflow will fail and register an event, if it cannot access the database during the specified period.

15

Element properties:

TargetMicrosoft.SQLServer.Windows.DatabaseReplica
Parent MonitorSystem.Health.AvailabilityState
CategoryAvailabilityHealth
EnabledTrue
Alert GenerateFalse
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Windows.MonitorType.AlwaysOnSystemPolicy
RemotableTrue
AccessibilityPublic
RunAsDefault

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Windows.Monitor.DatabaseReplica.JoinState" Accessibility="Public" Enabled="true" Target="SqlDiscW!Microsoft.SQLServer.Windows.DatabaseReplica" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Windows.MonitorType.AlwaysOnSystemPolicy" ConfirmDelivery="false">
<Category>AvailabilityHealth</Category>
<OperationalStates>
<OperationalState ID="Success" MonitorTypeStateID="HealthState" HealthState="Success"/>
<OperationalState ID="Critical" MonitorTypeStateID="ErrorState" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<MachineName>$Target/Host/Host/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DBEngine"]/MachineName$</MachineName>
<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>
<MonitoringType>$Target/Host/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<PolicyName>AlwaysOnDbrJoinStatePolicy</PolicyName>
<BagKey>3-$Target/Property[Type="SqlCoreLib!Microsoft.SQLServer.Core.DatabaseReplica"]/AvailabilityDatabaseName$</BagKey>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<TimeoutSeconds>300</TimeoutSeconds>
<IntervalSeconds>900</IntervalSeconds>
<SyncTime/>
</Configuration>
</UnitMonitor>