commands

^

Set-DbaRgWorkloadGroup

Author John McCall (@lowlydba), lowlydba.com
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Set-DbaRgWorkloadGroup on GitHub.
Want to see the Bill Of Health for this command? Check out Set-DbaRgWorkloadGroup.

Synopsis

Sets a workload group for use by the Resource Governor on the specified SQL Server.

Description

Sets a workload group for use by the Resource Governor on the specified SQL Server. A workload group represents a subset of resources of an instance of the Database Engine. When changing a plan affecting setting, the new setting will only take effect in previously cached plans after executing 'DBCC FREEPROCCACHE (pool_name);'.

Syntax

Set-DbaRgWorkloadGroup
    [[-SqlInstance] <DbaInstanceParameter[]>]
    [[-SqlCredential] <PSCredential>]
    [[-WorkloadGroup] <String[]>]
    [[-ResourcePool] <String>]
    [[-ResourcePoolType] <String>]
    [[-Importance] <String>]
    [[-RequestMaximumMemoryGrantPercentage] <Int32>]
    [[-RequestMaximumCpuTimeInSeconds] <Int32>]
    [[-RequestMemoryGrantTimeoutInSeconds] <Int32>]
    [[-MaximumDegreeOfParallelism] <Int32>]
    [[-GroupMaximumRequests] <Int32>]
    [-SkipReconfigure]
    [[-InputObject] <WorkloadGroup[]>]
    [-EnableException]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Set-DbaRgWorkloadGroup -SqlInstance sql2016 -WorkloadGroup "groupAdmin" -ResourcePool "poolAdmin"

Configures a workload group named "groupAdmin" in the resource pool "poolAdmin" for the instance sql2016.

Example: 2
PS C:\> Get-DbaRgWorkloadGroup | Where-Object Name -eq "groupSuperUsers" | Set-DbaRgWorkloadGroup -GroupMaximumRequests 2

Configures a workload group named "groupSuperUsers" by setting the maximum number of group requests to 2 for the instance sql2016.

Optional Parameters

-SqlInstance

The target SQL Server instance or instances.

Alias
Required False
Pipeline false
Default Value
-SqlCredential

Credential object used to connect to the Windows server as a different user

Alias
Required False
Pipeline false
Default Value
-WorkloadGroup

Name of the workload group to be configured.

Alias
Required False
Pipeline false
Default Value
-ResourcePool

Name of the resource pool to create the workload group in.

Alias
Required False
Pipeline false
Default Value
-ResourcePoolType

Internal or External

Alias
Required False
Pipeline false
Default Value
Accepted Values Internal,External
-Importance

Specifies the relative importance of a request in the workload group.

Alias
Required False
Pipeline false
Default Value
Accepted Values LOW,MEDIUM,HIGH
-RequestMaximumMemoryGrantPercentage

Specifies the maximum amount of memory that a single request can take from the pool.

Alias
Required False
Pipeline false
Default Value 0
-RequestMaximumCpuTimeInSeconds

Specifies the maximum amount of CPU time, in seconds, that a request can use.

Alias
Required False
Pipeline false
Default Value 0
-RequestMemoryGrantTimeoutInSeconds

Specifies the maximum time, in seconds, that a query can wait for a memory grant (work buffer memory) to become available.

Alias
Required False
Pipeline false
Default Value 0
-MaximumDegreeOfParallelism

Specifies the maximum degree of parallelism (MAXDOP) for parallel query execution.

Alias
Required False
Pipeline false
Default Value 0
-GroupMaximumRequests

Specifies the maximum number of simultaneous requests that are allowed to execute in the workload group.

Alias
Required False
Pipeline false
Default Value 0
-SkipReconfigure

Resource Governor requires a reconfiguriation for workload group changes to take effect. Use this switch to skip issuing a reconfigure for the Resource Governor.

Alias
Required False
Pipeline false
Default Value False
-InputObject

Allows input to be piped from Get-DbaRgWorkloadGroup.

Alias
Required False
Pipeline true (ByValue)
Default Value
-EnableException

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
-WhatIf

Shows what would happen if the command were to run. No actions are actually performed.

Alias wi
Required False
Pipeline false
Default Value
-Confirm

Prompts you for confirmation before executing any changing operations within the command.

Alias cf
Required False
Pipeline false
Default Value