Add-DatabaseToAvailabilityGroup
将一个或多个 SharePoint 数据库添加到SQL Server可用性组
语法
Add-DatabaseToAvailabilityGroup
[-AGName] <String>
[-AssignmentCollection <SPAssignmentCollection>]
-DatabaseName <String>
[-FileShare <String>]
[<CommonParameters>]
Add-DatabaseToAvailabilityGroup
[-AGName] <String>
[-AssignmentCollection <SPAssignmentCollection>]
[-FileShare <String>]
[-ProcessAllDatabases]
[<CommonParameters>]
说明
使用 Add-DatabaseToAvailabilityGroup cmdlet 将可用性组添加到场。
示例
示例 1
Add-DatabaseToAvailabilityGroup -AGName MyAvailabilityGroup -DatabaseName WSS_Content -FileShare \\backup\share\
本示例将数据库WSS_Content添加到名为“MyAvailabilityGroup”的可用性组。
示例 2
Add-DatabaseToAvailabilityGroup -AGName MyAvailabilityGroup -ProcessAllDatabases -FileShare \\backup\share\
本示例将附加到服务器场的所有 SharePoint 数据库添加到名为“MyAvailabilityGroup”的可用性组
参数
-AGName
要从中添加数据库的可用性组的名称。
Type: | String |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-AssignmentCollection
管理对象以便正确进行处理。 使用 SPWeb 或 SPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。 通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。 在使用 SPWeb、SPSite 或 SPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。
注意: 使用 Global 参数时,所有对象都包含在全局存储中。 If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.
Type: | SPAssignmentCollection |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-DatabaseName
要添加到可用性组的数据库的名称。 注意: 此参数不应与 ProcessAllDatabases 参数一起使用。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-FileShare
将数据库添加到可用性组时,从此位置进行备份/还原以将该数据库传播到所有副本。
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
-ProcessAllDatabases
将当前 SharePoint 场中的所有数据库添加到可用性组中。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Applies to: | SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019 |
输入
Microsoft.SharePoint.PowerShell.SPAssignmentCollection
输出
System.Object