创建资源池Create a Resource Pool

适用对象:是SQL Server 是Azure SQL 数据库(仅限托管实例)否Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server yesAzure SQL Database (Managed Instance only) noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

您可以使用 SQL Server Management StudioSQL Server Management StudioTransact-SQLTransact-SQL创建资源池。You can create a resource pool by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. 若要了解资源池的主体,请参阅 Resource Governor Resource PoolTo understand the principals of resource pools, see Resource Governor Resource Pool.

开始之前Before You Begin

限制和局限Limitations and Restrictions

最大 CPU 百分比必须大于或等于最小 CPU 百分比。The maximum CPU percentage must be equal to or higher than the minimum CPU percentage. 最大内存百分比必须大于或等于最小内存百分比。The maximum memory percentage must be equal to or higher than the minimum memory percentage.

所有资源池的最小 CPU 百分比和最小内存百分比的总和不得超过 100。The sums of the minimum CPU percentages and minimum memory percentages for all resource pools must not exceed 100.

权限Permissions

创建资源池需要 CONTROL SERVER 权限。Creating a resource pool requires CONTROL SERVER permission.

使用 SQL Server Management Studio 创建资源池Create a Resource Pool Using SQL Server Management Studio

使用 SQL Server Management StudioSQL Server Management StudioTo create a resource pool by using SQL Server Management StudioSQL Server Management Studio

  1. SQL Server Management StudioSQL Server Management Studio中,打开对象资源管理器,并依次逐步展开 “管理” 节点直至其中并包含 “资源调控器”In SQL Server Management StudioSQL Server Management Studio, open Object Explorer and recursively expand the Management node down to and including Resource Governor.

  2. 右键单击“Resource Governor” ,再单击“属性” 。Right-click Resource Governor, and then click Properties.

  3. “资源池” 网格中,单击空行中的第一列。In the Resource pools grid, click the first column in the empty row. 此列标记有星号 (*)。This column is labeled with an asterisk (*).

  4. 双击“名称” 列中的空单元格。Double-click the empty cell in the Name column. 键入要用于该资源池的名称。Type in the name that you want to use for the resource pool.

  5. 在行中单击或双击要更改的任何其他单元,然后输入新值。Click or double-click any other cells in the row you want to change, and enter the new values.

  6. 若要保存更改,请单击 “确定”To save the changes, click OK

使用 Transact-SQL 创建资源池Create a Resource Pool Using Transact-SQL

使用 Transact-SQLTransact-SQLTo create a resource pool by using Transact-SQLTransact-SQL

  1. 运行 CREATE RESOURCE POOLCREATE EXTERNAL RESOURCE POOL 语句,指定要设置的属性值。Run the CREATE RESOURCE POOL or CREATE EXTERNAL RESOURCE POOL statement specifying the property values to be set.

  2. 运行 ALTER RESOURCE GOVERNOR RECONFIGURE 语句。Run the ALTER RESOURCE GOVERNOR RECONFIGURE statement.

示例 (Transact-SQL)Example (Transact-SQL)

下面的示例创建名为 poolAdhoc的资源池。The following example creates a resource pool named poolAdhoc.

CREATE RESOURCE POOL poolAdhoc  
WITH (MAX_CPU_PERCENT = 20);  
GO  
ALTER RESOURCE GOVERNOR RECONFIGURE;  
GO  

另请参阅See Also

资源调控器 Resource Governor
启用资源调控器 Enable Resource Governor
Resource Governor Resource Pool Resource Governor Resource Pool
更改资源池设置 Change Resource Pool Settings
删除资源池 Delete a Resource Pool
使用模板配置资源调控器 Configure Resource Governor Using a Template
资源调控器工作负荷组 Resource Governor Workload Group
资源调控器分类器函数 Resource Governor Classifier Function
CREATE RESOURCE POOL (Transact-SQL) CREATE RESOURCE POOL (Transact-SQL)
ALTER RESOURCE GOVERNOR (Transact-SQL) ALTER RESOURCE GOVERNOR (Transact-SQL)
CREATE EXTERNAL RESOURCE POOL (Transact-SQL) CREATE EXTERNAL RESOURCE POOL (Transact-SQL)
ALTER EXTERNAL RESOURCE POOL (Transact-SQL)ALTER EXTERNAL RESOURCE POOL (Transact-SQL)