Table of Contents

Class AvailabilitySchema.AvailabilityGroup

Namespace
LinqToDB.Tools.DataProvider.SqlServer.Schemas
Assembly
linq2db.Tools.dll

sys.availability_groups (Transact-SQL)

Applies to: √ SQL Server (all supported versions)

Returns a row for each availability group for which the local instance of SQL Server hosts an availability replica. Each row contains a cached copy of the availability group metadata.


See sys.availability_groups.

[Table(Schema = "sys", Name = "availability_groups", IsView = true)]
public class AvailabilitySchema.AvailabilityGroup
Inheritance
AvailabilitySchema.AvailabilityGroup
Extension Methods

Properties

AutomatedBackupPreference

Preferred location for performing backups on the availability databases in this availability group. The following are the possible values and their descriptions.



0 : Primary. Backups should always occur on the primary replica.

1 : Secondary only. Performing backups on a secondary replica is preferable.

2 : Prefer Secondary. Performing backups on a secondary replica preferable, but performing backups on the primary replica is acceptable if no secondary replica is available for backup operations. This is the default behavior.

3 : Any Replica. No preference about whether backups are performed on the primary replica or on a secondary replica.



For more information, see Active Secondaries: Backup on Secondary Replicas (Always On Availability Groups).

[Column("automated_backup_preference")]
[Nullable]
public byte? AutomatedBackupPreference { get; set; }

Property Value

byte?

AutomatedBackupPreferenceDesc

Description of automated_backup_preference, one of:

PRIMARY

SECONDARY_ONLY

SECONDARY

NONE

[Column("automated_backup_preference_desc")]
[Nullable]
public string? AutomatedBackupPreferenceDesc { get; set; }

Property Value

string

BasicFeatures

Specifies whether this is a Basic availability group. For more information, see Basic Availability Groups (Always On Availability Groups).

[Column("basic_features")]
[Nullable]
public bool? BasicFeatures { get; set; }

Property Value

bool?

ClusterType

0: Windows Server failover cluster

1: External cluster (for example, Linux Pacemaker)

2: None

[Column("cluster_type")]
[Nullable]
public byte? ClusterType { get; set; }

Property Value

byte?

ClusterTypeDesc

Text description of cluster type

[Column("cluster_type_desc")]
[Nullable]
public string? ClusterTypeDesc { get; set; }

Property Value

string

DbFailover

Specifies whether the availability group supports failover for database health conditions. The DB_FAILOVER option of CREATE AVAILABILITY GROUP controls this setting.

[Column("db_failover")]
[Nullable]
public bool? DbFailover { get; set; }

Property Value

bool?

DtcSupport

Specifies whether DTC support has been enabled for this availability group. The DTC_SUPPORT option of CREATE AVAILABILITY GROUP controls this setting.

[Column("dtc_support")]
[Nullable]
public bool? DtcSupport { get; set; }

Property Value

bool?

FailureConditionLevel

User-defined failure condition level under which an automatic failover must be triggered, one of the integer values shown in the table immediately below this table.

The failure-condition levels (1-5) range from the least restrictive, level 1, to the most restrictive, level 5. A given condition level encompasses all of the less restrictive levels. Thus, the strictest condition level, 5, includes the four less restrictive condition levels (1-4), level 4 includes levels 1-3, and so forth.

To change this value, use the FAILURE_CONDITION_LEVEL option of the ALTER AVAILABILITY GROUPTransact-SQL statement.

[Column("failure_condition_level")]
[Nullable]
public int? FailureConditionLevel { get; set; }

Property Value

int?

GroupID

Unique identifier (GUID) of the availability group.

[Column("group_id")]
[NotNull]
public Guid GroupID { get; set; }

Property Value

Guid

HealthCheckTimeout

Wait time (in milliseconds) for the sp_server_diagnostics system stored procedure to return server-health information, before the server instance is assumed to be slow or not responding. The default value is 30000 milliseconds (30 seconds).

To change this value, use the HEALTH_CHECK_TIMEOUT option of the ALTER AVAILABILITY GROUPTransact-SQL statement.

[Column("health_check_timeout")]
[Nullable]
public int? HealthCheckTimeout { get; set; }

Property Value

int?

IsContained

1: Big data cluster master instance configured for high-availability.

0: all other.

[Column("is_contained")]
[Nullable]
public bool? IsContained { get; set; }

Property Value

bool?

IsDistributed

Specifies whether this is a distributed availability group. For more information, see Distributed Availability Groups (Always On Availability Groups).

[Column("is_distributed")]
[Nullable]
public bool? IsDistributed { get; set; }

Property Value

bool?

Name

Name of the availability group. This is a user-specified name that must be unique within the Windows Server Failover Cluster (WSFC).

[Column("name")]
[Nullable]
public string? Name { get; set; }

Property Value

string

RequiredSynchronizedSecondariesToCommit

The number of secondary replicas that must be in a synchronized state for a commit to complete

[Column("required_synchronized_secondaries_to_commit")]
[Nullable]
public int? RequiredSynchronizedSecondariesToCommit { get; set; }

Property Value

int?

ResourceGroupID

Resource Group ID for the WSFC cluster resource group of the availability group.

[Column("resource_group_id")]
[Nullable]
public string? ResourceGroupID { get; set; }

Property Value

string

ResourceID

Resource ID for the WSFC cluster resource.

[Column("resource_id")]
[Nullable]
public string? ResourceID { get; set; }

Property Value

string

SequenceNumber

Identifies the availability group configuration sequence. Incrementally increases every time the availability group primary replica updates the configuration of the group.

[Column("sequence_number")]
[Nullable]
public long? SequenceNumber { get; set; }

Property Value

long?

Version

The version of the availability group metadata stored in the Windows Failover Cluster. This version number is incremented when new features are added.

[Column("version")]
[Nullable]
public short? Version { get; set; }

Property Value

short?