启用资源调控器Enable Resource Governor

适用对象:是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

默认情况下,资源调控器处于关闭状态。The Resource Governor is turned off by default. 您可以使用 SQL Server Management StudioSQL Server Management Studio 或 Transact-SQL 启用资源调控器。You can enable the Resource Governor by using either SQL Server Management StudioSQL Server Management Studio or Transact-SQL.

开始之前Before You Begin

启用资源调控器会产生下列结果:Enabling the resource governor has the following results:

  • 为新连接运行分类器函数,以便可以将其工作负荷分配到工作负荷组。The classifier function is run for new connections so that their workloads can be assigned to workload groups.

  • 遵守并强制执行资源调控器配置中指定的资源限制。The resource limits that are specified in the Resource Governor configuration are honored and enforced.

  • 禁用资源调控器时所做的任何配置更改会影响在启用资源调控器之前就已存在的请求。Requests that existed before enabling Resource Governor are affected by any configuration changes that were made when the Resource Governor was disabled.

限制和局限Limitations and Restrictions

在用户事务中时,您不能使用 ALTER RESOURCE GOVERNOR 语句启用资源调控器。You cannot use the ALTER RESOURCE GOVERNOR statement to enable Resource Governor when in a user transaction.

权限Permissions

启用资源调控器需要 CONTROL SERVER 权限。Enabling the Resource Governor requires CONTROL SERVER permission.

使用对象资源管理器启用资源调控器Enable Resource Governor Using Object Explorer

使用对象资源管理器启用资源调控器To enable the Resource Governor by using Object Explorer

  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 Resource Governor.

  2. 右键单击“资源调控器” ,再单击“启用” 。Right-click Resource Governor, and then click Enable.

使用资源调控器属性启用资源调控器Enable Resource Governor Using Resource Governor Properties

使用“资源调控器属性”页启用资源调控器To enable the Resource Governor by using the Resource Governor Properties page

  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 Resource Governor.

  2. 右键单击“资源调控器” ,然后单击“属性” ,这将打开“资源调控器属性”页 。Right-click Resource Governor and then click Properties, this opens the Resource Governor Properties page.

  3. 单击 “启用资源调控器” 复选框,再单击 “确定”Click the Enable Resource Governor check box, and then click OK.

使用 Transact-SQL 启用资源调控器Enable Resource Governor Using Transact-SQL

使用 Transact-SQL 启用资源调控器To enable the Resource Governor by using Transact-SQL

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

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

以下示例启用资源调控器。The following example enables the Resource Governor.

ALTER RESOURCE GOVERNOR RECONFIGURE;  
GO  

另请参阅See Also

资源调控器 Resource Governor
禁用资源调控器 Disable Resource Governor
资源调控器资源池 Resource Governor Resource Pool
资源调控器工作负荷组 Resource Governor Workload Group
资源调控器分类器函数 Resource Governor Classifier Function
ALTER RESOURCE GOVERNOR (Transact-SQL)ALTER RESOURCE GOVERNOR (Transact-SQL)