Remove-DatabaseFromAvailabilityGroup

从 SQL Server 的可用性组中删除一个或多个 SharePoint 数据库。

语法

Remove-DatabaseFromAvailabilityGroup
      [-AGName] <String>
      [-AssignmentCollection <SPAssignmentCollection>]
      -DatabaseName <String>
      [-Force]
      [-KeepSecondaryData]
      [<CommonParameters>]
Remove-DatabaseFromAvailabilityGroup
      [-AGName] <String>
      [-AssignmentCollection <SPAssignmentCollection>]
      [-Force]
      [-KeepSecondaryData]
      [-ProcessAllDatabases]
      [<CommonParameters>]

说明

此 cmdlet 包含多个参数集。 您可以只使用来自一个参数集的参数,也可以不合并来自不同参数集的参数。 有关如何使用参数集的详细信息,请参阅 https://msdn.microsoft.com/library/dd878348(VS.85).aspx

示例

------------------示例------------------

Remove-DatabaseFromAvailabilityGroup -AGName MyAvailabilityGroup -DatabaseName WSS_Content

本示例从 WSS_Content 数据库中删除名为“MyAvailabilityGroup”的可用性组。

参数

-AGName

要从中删除数据库的可用性组的名称。

Type:String
Position:0
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-DatabaseName

要从可用性组中删除的数据库的名称。

注意:不应将此参数与 ProcessAllDatabases 参数结合使用。

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-Force

从组中强制删除。

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-KeepSecondaryData

Specifies that copies of the databases on the replicas in the availability group will not be deleted. Otherwise, those database copies will be dropped.

Type:SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

-工作分配

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

When the Global parameter is used, all objects are contained in the global store. 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
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Server 2013, SharePoint Server 2016, SharePoint Server 2019

输入

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

输出

System.Object