Author | John McCall (@lowlydba), lowlydba.com |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Set-DbaResourceGovernor on GitHub.
Want to see the Bill Of Health for this command? Check out Set-DbaResourceGovernor.
Sets the Resource Governor feature on the specified SQL Server to be enabled or disabled,
along with specifying an optional classifier function.
In order to utilize Resource Governor, it has to be enabled for an instance and
have a classifier function specified. This function toggles the enabled status
and sets the classifier function.
Set-DbaResourceGovernor
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[-Enabled]
[-Disabled]
[[-ClassifierFunction] <String>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Set-DbaResourceGovernor -SqlInstance sql2016 -Enabled
Sets Resource Governor to enabled for the instance sql2016.
PS C:\> Set-DbaResourceGovernor -SqlInstance sql2012\dev1 -Disabled
Sets Resource Governor to disabled for the instance dev1 on sq2012.
PS C:\> Set-DbaResourceGovernor -SqlInstance sql2012\dev1 -ClassifierFunction 'fnRGClassifier' -Enabled
Sets Resource Governor to enabled for the instance dev1 on sq2012 and sets the classifier function to be 'fnRGClassifier'.
PS C:\> Set-DbaResourceGovernor -SqlInstance sql2012\dev1 -ClassifierFunction 'NULL' -Enabled
Sets Resource Governor to enabled for the instance dev1 on sq2012 and sets the classifier function to be NULL.
The target SQL Server instance or instances.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Credential object used to connect to the Windows server as a different user
Alias | Credential |
Required | False |
Pipeline | false |
Default Value |
Enables the Resource Governor.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Disables the Resource Governor.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
Sets the classifier function for Resource Governor.
Alias | |
Required | False |
Pipeline | false |
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 |