AvailabilityGroupData Class

Definition

Availability Group Data this Object contains info for an Availability Group

C#
public class AvailabilityGroupData
Inheritance
AvailabilityGroupData

Constructors

AvailabilityGroupData()

ctor: the base ctor set replicas = null set listener = new listener set backupreference = default secondary set Sync option = full

AvailabilityGroupData(ServerConnection)

the ctor for New AG, only Service Connection is passed

Properties

AvailabilityGroupListener

AG listener object

AvailabilityGroupReplicas

All replicas - including the primary

AvailabilityGroupState

AG State flag

BackupLocationInLinuxFormat

Network share location in Linux format used for storing backup files when user chooses to do backup/restore Data Synchronization

BackupLocationInWindowsFormat

Network share location in Windows format used for storing backup files when user chooses to do backup/restore Data Synchronization

BackupPreference

Availability Group BackUp Preference

ClusterName

Windows failover cluster DNS name

ClusterType

Gets or sets the cluster type

DataSecondaries

Secondary replicas excluding the ConfigurationOnly replica

ExistingAvailabilityDatabases

Databases that are already part of existing AvailabilityGroup

GroupName

Availability Group name

IsBasic

Gets or sets a flag indicating whether to create a BASIC or ADVANCED Availability Group.

IsConnectedToPrimary

Determines if PrimaryServer is actually the primary. Returns true if yes, false otherwise.

IsCrossPlatform

Gets a boolean value indicating whether the replicas of the availability group are on different OS platforms.

IsDatabaseHealthTriggerOn

Gets or sets a flag indicating whether a DB Health event triggers Failover to a auto-failover synchronous replica.

IsDtcSupportEnabled

Gets or sets a flag indicating whether per-database DTC support is enabled.

IsPrimaryInQuorum

Determines if the primary connection is part of cluster quorum. Returns true if yes, false otherwise.

NewAvailabilityDatabases

Databases that are being added to AvailabilityGroup

PerformDataSynchronization

Data Synchronization preference

PrimaryServer

Primary Server object property

RequiredSynchronizedSecondariesToCommit

Gets or sets the required copies to commit

Secondaries

Secondary replicas

SqlAvailabilityGroup

This property is used specially for creating a listener. We want the step of creating a AG listener not to include in the step of creating AG. However, The creation of a listener needs such info.

WillPerformAutomaticSeeding

Checks to see if DataSynchronizationOption is AutomaticSeeding

WillPerformBackupRestore

Checks to see if DataSyncronization is set to full

WillPerformDatabaseInitialization

Checks to see if DataSynchronizationOption is Full or AutomaticSeeding

WillPerformDatabaseJoin

Checks to see if DataSynchronizationOption is Full, JoinOnly or AutomaticSeeding

Methods

AddAvailabilityDatabase(PrimaryDatabaseData)

The method used to add a database to the AvailabilityGroup

AddExistingAvailabilityDatabase(PrimaryDatabaseData)

The method used to add a database to the AvailabilityGroup

GetBackupPathForServer(Server)

Get the backup location for the server

GetLoginNames(AvailabilityGroupReplica)

Return the Login Names Method behavior based on the input parameter:

  1. If the replica is a non-Windows replica, returns an empty collection
  2. else go through all replicas in Replicas and return KeyValuePair contains a localServiceAccount and a flag for the existance of sid
GetPrimaryTotalDataFileAndLogSize(Double, Double)

retrieve the total size of datafiles and logs of the primary server

HasViewServerStatePermission(Server)

Helper method for checking View Server State Permissiom

Extension Methods

Applies to

Product Versions
Microsoft.SqlServer.SqlManagementObjects 160.2004021.0