Author | John McCall (@lowlydba), lowlydba.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Remove-DbaRgResourcePool on GitHub.
Want to see the Bill Of Health for this command? Check out Remove-DbaRgResourcePool.
Removes internal or external resource pools from SQL Server Resource Governor configuration
Removes user-defined resource pools from SQL Server's Resource Governor, freeing up the allocated memory, CPU, and IO resources for redistribution to other workloads. This is typically done when cleaning up unused resource pools, consolidating workload management, or reconfiguring resource allocation strategies.
Resource pools define the physical resource boundaries (memory, CPU, IO) that can be assigned to different database workloads through workload groups. Removing unused pools helps maintain a clean Resource Governor configuration and prevents resource fragmentation.
The function automatically reconfigures Resource Governor after pool removal to ensure changes take effect immediately, unless you specify -SkipReconfigure for batch operations.
Remove-DbaRgResourcePool
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-ResourcePool] <String[]>]
[[-Type] <String>]
[-SkipReconfigure]
[[-InputObject] <Object[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Remove-DbaRgResourcePool -SqlInstance sql2016 -ResourcePool "poolAdmin" -Type Internal
Removes an internal resource pool named "poolAdmin" for the instance sql2016.
PS C:\> Get-DbaRgResourcePool -SqlInstance sql2016 -Type "Internal" | Where-Object { $_.IsSystemObject -eq $false } | Remove-DbaRgResourcePool
Removes all user internal resource pools for the instance sql2016 by piping output from Get-DbaRgResourcePool.
The target SQL Server instance or instances.
Alias | |
Required | False |
Pipeline | true (ByValue, ByPropertyName) |
Default Value |
Credential object used to connect to the Windows server as a different user
Alias | |
Required | False |
Pipeline | true (ByPropertyName) |
Default Value |
Name of the resource pool to remove from Resource Governor configuration. Accepts multiple pool names.
Use this when you need to clean up specific unused pools or consolidate resource management by removing obsolete pools.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies whether to remove Internal or External resource pools. Defaults to Internal.
Internal pools manage CPU and memory for regular SQL Server workloads, while External pools manage resources for R/Python/Java external scripts.
Alias | |
Required | False |
Pipeline | false |
Default Value | Internal |
Accepted Values | Internal,External |
Skips the automatic Resource Governor reconfiguration after removing resource pools. By default, Resource Governor is reconfigured to apply changes immediately.
Use this when removing multiple pools in batch operations to avoid repeated reconfigurations, then manually reconfigure once at the end.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Accepts resource pool objects piped from Get-DbaRgResourcePool for removal. Supports both Internal and External resource pool objects.
Use this for pipeline operations when you need to filter pools before removal or process multiple pools efficiently.
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Shows what would happen if the command were to run. No actions are actually performed.
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
Prompts you for confirmation before executing any changing operations within the command.
Alias | cf |
Required | False |
Pipeline | false |
Default Value |