| title | Move a Workload Group | ||
|---|---|---|---|
| description | Learn how to move a resource governor workload group to a different resource pool by using either SQL Server Management Studio or Transact-SQL. | ||
| author | WilliamDAssafMSFT | ||
| ms.author | wiassaf | ||
| ms.reviewer | dfurman | ||
| ms.date | 01/02/2025 | ||
| ms.service | sql | ||
| ms.subservice | performance | ||
| ms.topic | how-to | ||
| f1_keywords |
|
||
| helpviewer_keywords |
|
||
| monikerRange | >= sql-server-2016 || >= sql-server-linux-2017 || = azuresqldb-mi-current |
[!INCLUDE SQL Server SQL MI]
You can move a resource governor workload group to a different resource pool by using either [!INCLUDEssManStudioFull] or [!INCLUDEtsql].
You can't move a workload group if there's a pending resource governor configuration operation.
- You can't move a workload group if there's a pending resource governor configuration operation. You can determine whether there's a configuration pending by querying the sys.dm_resource_governor_configuration dynamic management view to get the current value of the
is_configuration_pendingcolumn. - If a workload group contains active sessions, moving it to a different resource pool fails when the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement is executed to apply the change. To avoid this problem, you can take one of the following actions:- Wait until all sessions in the affected group disconnect, and then execute the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement. - Explicitly stop sessions in the affected group by using the KILL T-SQL command, and then execute the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement. If you decide that you don't want to explicitly stop sessions, move the group to the original resource pool. - Restart the server. When the server restarts, a moved group uses the new resource pool assignment.
- Wait until all sessions in the affected group disconnect, and then execute the
Moving a workload group requires the CONTROL SERVER permission.
To move a workload group by using SQL Server Management Studio (SSMS):
- In Object Explorer, expand the Management node down to Resource Governor.
- Open the Resource Governor context menu and select Properties. This opens the Resource Governor Properties page.
- In the Resource Pools grid, select the resource pool containing the workload group to be moved. The Workload Groups grid now lists the workload groups in that resource pool.
- In the Workload Groups grid, open the context menu for the workload group to be moved, and select Move to. This opens a Move Workload Group window.
- Available resource pools are displayed in the window. Select the resource pool that you want to move the workload group to, and select OK.
- Select OK to execute the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement. - If the create or reconfigure operation fails for the resource pool or workload group, a summary error message appears below the title of the property page. To see a detailed error message, select the down arrow on the error message.
To move a workload group by using [!INCLUDEtsql]:
- Execute the ALTER WORKLOAD GROUP statement specifying the name of the workload group to be moved and the resource pool to which it should be moved.
- Execute the
ALTER RESOURCE GOVERNOR RECONFIGUREstatement.
The following example moves a workload group named groupAdhoc to the default resource pool.
ALTER WORKLOAD GROUP groupAdhoc USING [default];
ALTER RESOURCE GOVERNOR RECONFIGURE;