Remove-DatabaseFromAvailabilityGroup
從 SQL Server 的可用性群組中移除一或多個 SharePoint 資料庫。
Syntax
Remove-DatabaseFromAvailabilityGroup
[-AGName] <String>
[-AssignmentCollection <SPAssignmentCollection>]
-DatabaseName <String>
[-Force]
[-KeepSecondaryData]
[<CommonParameters>]
Remove-DatabaseFromAvailabilityGroup
[-AGName] <String>
[-AssignmentCollection <SPAssignmentCollection>]
[-Force]
[-KeepSecondaryData]
[-ProcessAllDatabases]
[<CommonParameters>]
Description
此 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 |
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 參數時,所有物件會包含在全域儲存區內。 若未立即使用物件,或未使用 Stop-SPAssignment 命令處置物件,將會發生記憶體不足的狀況。
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 |
-Force
強制從群組中移除。
Type: | SwitchParameter |
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 |
-KeepSecondaryData
指定不會刪除可用性群組中的複本上的資料庫副本。 否則會捨棄這些資料庫副本。
Type: | SwitchParameter |
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