SqlAGDatabases is used to add databases or remove databases from a specified availability group.
When a replica has Automatic seeding on Automatic, no restore is use for that replica. When all replicas are on automatic seeding, no backup is made, unless the database has never been backuped.
Source |
|
DSC Resource |
|
Documentation |
-
Target machine must be running Windows Server 2012 or later.
-
Target machine must be running SQL Server Database Engine 2012 or later.
-
Target machine must be running Windows Management Framework (WMF) 5 or later.
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
Mandatory |
Hashtable[] |
List of SQL availability groups databases. |
Parameter | Attribute | DataType | Description | Allowed Values |
---|---|---|---|---|
DatabaseName |
Mandatory |
String[] |
The name of the database(s) to add to the availability group. This accepts wildcards. |
|
InstanceName |
Key |
String |
Name of the SQL Server instance where the primary replica of the availability group lives. If the availability group is not currently on this instance, the resource will attempt to connect to the instance where the primary replica lives. |
|
ServerName |
Key |
String |
Hostname of the SQL Server where the primary replica of the availability group lives. If the availability group is not currently on this server, the resource will attempt to connect to the server where the primary replica lives. |
|
AvailabilityGroupName |
Key |
String |
The name of the availability group in which to manage the database membership(s). |
|
BackupPath |
Mandatory |
String |
The path used to seed the availability group replicas. This should be a path that is accessible by all of the replicas. |
|
Enure |
String |
Determines whether the alias should be added ( |
|
|
Force |
Bool |
When parameter Ensure is set to This parameter is ignored when parameter Ensure is set to |
|
|
MatchDatabaseOwner |
Bool |
If set to If set to |
|
|
ReplaceExisting |
Bool |
If set to If set to |
|
|
ProcessOnlyOnActiveNode |
Bool |
Specifies that the resource will only determine if a change is needed if the target node is the active host of the SQL Server instance. |
|
|
IsActiveNode |
Bool |
Returns if the current node is actively hosting the SQL Server instance. |
|
SqlAGDatabases:
Values:
- DatabaseName: DB1
AvailabilityGroupName: AGTest1
BackupPath: \\Server1\Backup
InstanceName: MSSQLSERVER
ServerName: SQL1
ProcessOnlyOnActiveNode: true
- DatabaseName: DB2
AvailabilityGroupName: AGTest2
BackupPath: \\Server1\Backup
InstanceName: MSSQLSERVER
ServerName: SQL1
ProcessOnlyOnActiveNode: true