Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Commit 39d40c6

Browse files
committed
updates for isolation
1 parent 6f26c56 commit 39d40c6

3 files changed

Lines changed: 253 additions & 2 deletions

File tree

docs/relational-databases/resource-governor/create-a-workload-group.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ ms.topic: conceptual
99
helpviewer_keywords:
1010
- "Resource Governor, workload group create"
1111
- "workload groups [SQL Server], create"
12-
ms.assetid: 072868ec-ceff-4db6-941b-281af731a067
1312
author: julieMSFT
1413
ms.author: jrasnick
15-
manager: craigg
14+
manager: craigg
1615
---
1716
# Create a Workload Group
1817
[!INCLUDE[appliesto-ss-asdbmi-xxxx-xxx-md](../../includes/appliesto-ss-asdbmi-xxxx-xxx-md.md)]
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
---
2+
title: "CREATE WORKLOAD GROUP (Transact-SQL) | Microsoft Docs"
3+
ms.custom: ""
4+
ms.date: "06/05/2019"
5+
ms.prod: sql
6+
ms.prod_service: "sql-database"
7+
ms.reviewer: ""
8+
ms.technology: t-sql
9+
ms.topic: "language-reference"
10+
f1_keywords:
11+
- "WORKLOAD GROUP"
12+
- "WORKLOAD_GROUP_TSQL"
13+
- "CREATE WORKLOAD GROUP"
14+
- "CREATE_WORKLOAD_GROUP_TSQL"
15+
dev_langs:
16+
- "TSQL"
17+
helpviewer_keywords:
18+
- "CREATE WORKLOAD GROUP statement"
19+
author: julieMSFT
20+
ms.author: jrasnick
21+
manager: craigg
22+
monikerRange: "=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azure-sqldw-latest||=azuresqldb-mi-current"
23+
---
24+
# CREATE WORKLOAD GROUP (Transact-SQL)
25+
26+
## Click a product!
27+
28+
In the following row, click whichever product name you're interested in. The click displays different content here on this webpage, appropriate for whichever product you click.
29+
30+
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=sqlallproducts-allversions"
31+
32+
> |||||
33+
> |---|---|---|---|
34+
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)|||
35+
36+
&nbsp;
37+
38+
## SQL Server
39+
40+
[!INCLUDE[tsql-appliesto-ss2008-xxxx-asdw-xxx-md](../../includes/tsql-appliesto-ss2008-xxxx-asdw-xxx-md.md)]
41+
42+
Creates a Resource Governor workload group and associates the workload group with a Resource Governor resource pool. Resource Governor is not available in every edition of [!INCLUDE[msCoName](../../includes/msconame-md.md)][!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)]. For a list of features that are supported by the editions of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], see [Features Supported by the Editions of SQL Server 2016](~/sql-server/editions-and-supported-features-for-sql-server-2016.md).
43+
44+
![Topic link icon](../../database-engine/configure-windows/media/topic-link.gif "Topic link icon") [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).
45+
46+
## Syntax
47+
48+
```
49+
CREATE WORKLOAD GROUP group_name
50+
[ WITH
51+
( [ IMPORTANCE = { LOW | MEDIUM | HIGH } ]
52+
[ [ , ] REQUEST_MAX_MEMORY_GRANT_PERCENT = value ]
53+
[ [ , ] REQUEST_MAX_CPU_TIME_SEC = value ]
54+
[ [ , ] REQUEST_MEMORY_GRANT_TIMEOUT_SEC = value ]
55+
[ [ , ] MAX_DOP = value ]
56+
[ [ , ] GROUP_MAX_REQUESTS = value ] )
57+
]
58+
[ USING {
59+
[ pool_name | "default" ]
60+
[ [ , ] EXTERNAL external_pool_name | "default" ] ]
61+
} ]
62+
[ ; ]
63+
```
64+
65+
## Arguments
66+
67+
*group_name*
68+
Is the user-defined name for the workload group. *group_name* is alphanumeric, can be up to 128 characters, must be unique within an instance of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], and must comply with the rules for [identifiers](../../relational-databases/databases/database-identifiers.md).
69+
70+
IMPORTANCE = { LOW | **MEDIUM** | HIGH }
71+
Specifies the relative importance of a request in the workload group. Importance is one of the following, with MEDIUM being the default:
72+
73+
- LOW
74+
- MEDIUM (default)
75+
- HIGH
76+
77+
> [!NOTE]
78+
> Internally each importance setting is stored as a number that is used for calculations.
79+
80+
IMPORTANCE is local to the resource pool; workload groups of different importance inside the same resource pool affect each other, but do not affect workload groups in another resource pool.
81+
82+
REQUEST_MAX_MEMORY_GRANT_PERCENT = *value*
83+
Specifies the maximum amount of memory that a single request can take from the pool. *value* is a percentage relative to the resource pool size specified by MAX_MEMORY_PERCENT. *value* is an integer up to [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)] and afloat starting with [!INCLUDE[sql-server-2019](../../includes/sssqlv15-md.md)], with a default setting of 25. The allowed range for *value* is from 1 through 100.
84+
85+
> [!NOTE]
86+
> The amount specified only refers to query execution grant memory.
87+
>
88+
> - Setting *value* to 0 prevents queries with SORT and HASH MATCH operations in user-defined workload groups from running. > - We do not recommend setting *value* greater than 70 because the server may be unable to set aside enough free memory if other concurrent queries are running. This may eventually lead to query time-out error 8645.
89+
> - If the query memory requirements exceed the limit that is specified by this parameter, the server does the following:
90+
>
91+
> For user-defined workload groups, the server tries to reduce the query degree of parallelism until the memory requirement falls under the limit, or until the degree of parallelism equals 1. If the query memory requirement is still greater than the limit, error 8657 occurs.
92+
>
93+
> For internal and default workload groups, the server permits the query to obtain the required memory.
94+
>
95+
> Be aware that both cases are subject to time-out error 8645 if the server has insufficient physical memory.
96+
97+
REQUEST_MAX_CPU_TIME_SEC = *value*
98+
Specifies the maximum amount of CPU time, in seconds, that a request can use. *value* must be 0 or a positive integer. The default setting for *value* is 0, which means unlimited.
99+
100+
> [!NOTE]
101+
> By default, Resource Governor will not prevent a request from continuing if the maximum time is exceeded. However, an event will be generated. For more information, see [CPU Threshold Exceeded Event Class](../../relational-databases/event-classes/cpu-threshold-exceeded-event-class.md).
102+
> [!IMPORTANT]
103+
> Starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] SP2 and [!INCLUDE[ssSQL17](../../includes/sssql17-md.md)] CU3, and using [trace flag 2422](../../t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql.md), Resource Governor will abort a request when the maximum time is exceeded.
104+
105+
REQUEST_MEMORY_GRANT_TIMEOUT_SEC = *value*
106+
Specifies the maximum time, in seconds, that a query can wait for a memory grant (work buffer memory) to become available. *value* must be 0 or a positive integer. The default setting for *value*, 0, uses an internal calculation based on query cost to determine the maximum time.
107+
108+
> [!NOTE]
109+
> A query does not always fail when memory grant time-out is reached. A query will only fail if there are too many concurrent queries running. Otherwise, the query may only get the minimum memory grant, resulting in reduced query performance.
110+
111+
MAX_DOP = *value*
112+
Specifies the maximum degree of parallelism (DOP) for parallel requests. *value* must be 0 or a positive integer. The allowed range for *value* is from 0 through 64. The default setting for *value*, 0, uses the global setting. MAX_DOP is handled as follows:
113+
114+
- MAX_DOP as a query hint is effective as long as it does not exceed workload group MAX_DOP. If the MAXDOP query hint value exceeds the value that is configured by using the Resource Governor, the Database Engine uses the Resource Governor MAXDOP value.
115+
- MAX_DOP as a query hint always overrides sp_configure 'max degree of parallelism'.
116+
- Workload group MAX_DOP overrides sp_configure 'max degree of parallelism'.
117+
- If the query is marked as serial at compile time, it cannot be changed back to parallel at run time regardless of the workload group or sp_configure setting.
118+
- After DOP is configured, it can only be lowered on grant memory pressure. Workload group reconfiguration is not visible while waiting in the grant memory queue.
119+
120+
GROUP_MAX_REQUESTS = *value*
121+
Specifies the maximum number of simultaneous requests that are allowed to execute in the workload group. *value* must be a 0 or a positive integer. The default setting for *value* is 0, and allows unlimited requests. When the maximum concurrent requests are reached, a user in that group can log in, but is placed in a wait state until concurrent requests are dropped below the value specified.
122+
123+
USING { *pool_name* | **"default"** }
124+
Associates the workload group with the user-defined resource pool identified by *pool_name*. This in effect puts the workload group in the resource pool. If *pool_name* is not provided, or if the USING argument is not used, the workload group is put in the predefined Resource Governor default pool.
125+
126+
"default" is a reserved word and when used with USING, must be enclosed by quotation marks ("") or brackets ([]).
127+
128+
> [!NOTE]
129+
> Predefined workload groups and resource pools all use lower case names, such as "default". This should be taken into account for servers that use case-sensitive collation. Servers with case-insensitive collation, such as SQL_Latin1_General_CP1_CI_AS, will treat "default" and "Default" as the same.
130+
131+
EXTERNAL external_pool_name | "default"
132+
**Applies to**: [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] ( [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)] through [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)]).
133+
134+
Workload group can specify an external resource pool. You can define a workload group and associate with 2 pools:
135+
136+
- A resource pool for [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] workloads and queries
137+
- An external resource pool for external processes. For more information, see [sp_execute_external_script &#40;Transact-SQL&#41;](../../relational-databases/system-stored-procedures/sp-execute-external-script-transact-sql.md).
138+
139+
## Remarks
140+
141+
When `REQUEST_MEMORY_GRANT_PERCENT` is used, index creation is allowed to use more workspace memory than what is initially granted for improved performance. This special handling is supported by Resource Governor in [!INCLUDE[ssCurrent](../../includes/sscurrent-md.md)]. However, the initial grant and any additional memory grant are limited by resource pool and workload group settings.
142+
143+
### Index Creation on a Partitioned Table
144+
145+
The memory consumed by index creation on non-aligned partitioned table is proportional to the number of partitions involved. If the total required memory exceeds the per-query limit `REQUEST_MAX_MEMORY_GRANT_PERCENT` imposed by the Resource Governor workload group setting, this index creation may fail to execute. Because the *"default"* workload group allows a query to exceed the per-query limit with the minimum required memory, the user may be able to run the same index creation in *"default"* workload group, if the *"default"* resource pool has enough total memory configured to run such query.
146+
147+
## Permissions
148+
149+
Requires `CONTROL SERVER` permission.
150+
151+
## Example
152+
153+
- Create a workload group named newReports
154+
155+
It uses the Resource Governor default settings and is in the Resource Governor default pool. The example specifies the `default` pool, but this is not required.
156+
157+
```sql
158+
CREATE WORKLOAD GROUP newReports
159+
USING "default" ;
160+
GO
161+
```
162+
163+
## See Also
164+
165+
- [ALTER WORKLOAD GROUP &#40;Transact-SQL&#41;](../../t-sql/statements/alter-workload-group-transact-sql.md)
166+
- [DROP WORKLOAD GROUP &#40;Transact-SQL&#41;](../../t-sql/statements/drop-workload-group-transact-sql.md)
167+
- [CREATE RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/create-resource-pool-transact-sql.md)
168+
- [ALTER RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/alter-resource-pool-transact-sql.md)
169+
- [DROP RESOURCE POOL &#40;Transact-SQL&#41;](../../t-sql/statements/drop-resource-pool-transact-sql.md)
170+
- [ALTER RESOURCE GOVERNOR &#40;Transact-SQL&#41;](../../t-sql/statements/alter-resource-governor-transact-sql.md)
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
title: "Title (Transact-SQL) | Microsoft Docs"
3+
description:
4+
ms.custom: ""
5+
ms.date: 05/22/2019
6+
ms.prod: sql
7+
ms.prod_service: "database-engine, sql-database, sql-data-warehouse"
8+
ms.reviewer: ""
9+
ms.technology: t-sql
10+
ms.topic: "language-reference"
11+
dev_langs:
12+
- "TSQL"
13+
helpviewer_keywords:
14+
author: julieMSFT
15+
ms.author: jrasnick
16+
manager: craigg
17+
monikerRange: "=azuresqldb-current||=azuresqldb-current||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azure-sqldw-latest||=azuresqldb-mi-current"
18+
---
19+
# Title (Transact-SQL)
20+
21+
Sets database options in [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], [!INCLUDE[ssSDSfull](../../includes/sssdsfull-md.md)] and [!INCLUDE[ssSDW](../../includes/sssdw-md.md)]. For other ALTER DATABASE options, see [ALTER DATABASE](../../t-sql/statements/alter-database-transact-sql.md).
22+
23+
Click one of the following tabs for the syntax, arguments, remarks, permissions, and examples for a particular SQL version with which you're working.
24+
25+
For more information about the syntax conventions, see [Transact-SQL Syntax Conventions](../../t-sql/language-elements/transact-sql-syntax-conventions-transact-sql.md).
26+
27+
## Click a product!
28+
29+
In the following row, click whichever product name you're interested in. The click displays different content here on this webpage, appropriate for whichever product you click.
30+
31+
::: moniker range=">=sql-server-2016||>=sql-server-linux-2017||=sqlallproducts-allversions"
32+
33+
> |||||
34+
> |---|---|---|---|
35+
> |**_\* SQL Server \*_** &nbsp;|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)|||
36+
37+
&nbsp;
38+
39+
## SQL Server
40+
41+
42+
::: moniker-end
43+
::: moniker range="=azuresqldb-current||=sqlallproducts-allversions"
44+
45+
> ||||
46+
> |---|---|---|
47+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|**_\* SQL Database<br />single database/elastic pool \*_** &nbsp;|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)||[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)||||
48+
49+
&nbsp;
50+
51+
## Azure SQL Database single database/elastic pool
52+
53+
54+
55+
::: moniker-end
56+
::: moniker range="=azuresqldb-mi-current||=sqlallproducts-allversions"
57+
58+
> ||||
59+
> |---|---|---|
60+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current) |**_\* SQL Database<br />managed instance \*_** &nbsp;||[SQL Data<br />Warehouse](alter-database-transact-sql-set-options.md?view=azure-sqldw-latest)||||
61+
62+
&nbsp;
63+
64+
## Azure SQL Database managed instance
65+
66+
67+
68+
::: moniker-end
69+
::: moniker range="=azure-sqldw-latest||=sqlallproducts-allversions"
70+
71+
> ||||
72+
> |---|---|---|
73+
> |[SQL Server](alter-database-transact-sql-set-options.md?view=sql-server-2017)|[SQL Database<br />single database/elastic pool](alter-database-transact-sql-set-options.md?view=azuresqldb-current)|[SQL Database<br />managed instance](alter-database-transact-sql-set-options.md?view=azuresqldb-mi-current)|**_\* SQL Data<br />Warehouse \*_** &nbsp;||||
74+
75+
&nbsp;
76+
77+
## Azure SQL Data Warehouse
78+
79+
## Syntax
80+
81+
82+
::: moniker-end

0 commit comments

Comments
 (0)