RECONFIGURE (Transact-SQL)RECONFIGURE (Transact-SQL)

适用对象: yesSQL ServeryesAzure SQL 数据库noAzure SQL 数据仓库no并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

更新使用 sp_configure 系统存储过程更改的配置选项的当前已配置值(sp_configure 结果集中的 config_value 列) 。Updates the currently configured value (the config_value column in the sp_configure result set) of a configuration option changed with the sp_configure system stored procedure. 由于有些配置选项需要服务器停止并重新启动才能更新当前运行的值,因此 RECONFIGURE 并不总是为已更改的配置值更新当前运行的值(sp_configure 结果集中的 run_value 列) 。Because some configuration options require a server stop and restart to update the currently running value, RECONFIGURE does not always update the currently running value (the run_value column in the sp_configure result set) for a changed configuration value.

主题链接图标 TRANSACT-SQL 语法约定Topic link icon Transact-SQL Syntax Conventions

语法Syntax

    
RECONFIGURE [ WITH OVERRIDE ]    

参数Arguments

RECONFIGURERECONFIGURE
指定如果配置设置不需要服务器停止并重新启动,则更新当前运行的值。Specifies that if the configuration setting does not require a server stop and restart, the currently running value should be updated. RECONFIGURE 还会检查新的配置值中是否有无效值(例如,在 syscharsets 中不存在的排序顺序值)或非建议值 。RECONFIGURE also checks the new configuration values for either values that are not valid (for example, a sort order value that does not exist in syscharsets) or nonrecommended values. 对于那些不需要服务器停止并重新启动的配置选项,其当前运行的值和当前配置的值在指定 RECONFIGURE 之后应当相同。With those configuration options not requiring a server stop and restart, the currently running value and the currently configured values for the configuration option should be the same value after RECONFIGURE is specified.

WITH OVERRIDEWITH OVERRIDE
禁用对 recovery interval 高级配置选项的配置值检查(以查找无效值或非建议值) 。Disables the configuration value checking (for values that are not valid or for nonrecommended values) for the recovery interval advanced configuration option.

使用 WITH OVERRIDE 选项几乎可以重新配置任何配置选项,但仍然要避免某些灾难性错误。Almost any configuration option can be reconfigured by using the WITH OVERRIDE option, however some fatal errors are still prevented. 例如,不能使用大于max server memory 配置选项中指定的值来配置 min server memory 配置选项 。For example, the min server memory configuration option cannot be configured with a value greater than the value specified in the max server memory configuration option.

RemarksRemarks

sp_configure 不接受超出所记录的各配置选项值有效范围的新配置选项值 。sp_configure does not accept new configuration option values out of the documented valid ranges for each configuration option.

不允许在显式或隐式事务中使用 RECONFIGURE。RECONFIGURE is not allowed in an explicit or implicit transaction. 同时对多个选项进行重新配置时,如果任意重新配置操作失败,所有重新配置操作都将无效。When you reconfigure several options at the same time, if any of the reconfigure operations fail, none of the reconfigure operations will take effect.

重新配置资源调控器时,请参阅的 ALTER RESOURCE GOVERNOR (Transact-SQL) 的 RECONFIGURE 选项。When reconfiguring the resource governor, see the RECONFIGURE option of ALTER RESOURCE GOVERNOR (Transact-SQL).

权限Permissions

默认情况下,被授予 ALTER SETTINGS 权限的用户同时拥有 RECONFIGURE 权限。RECONFIGURE permissions default to grantees of the ALTER SETTINGS permission. sysadmin 和 serveradmin 固定服务器角色隐式持有该权限 。The sysadmin and serveradmin fixed server roles implicitly hold this permission.

示例Examples

以下示例将 recovery interval 配置选项的上限设置为 75 分钟,并使用 RECONFIGURE WITH OVERRIDE 进行安装。The following example sets the upper limit for the recovery interval configuration option to 75 minutes and uses RECONFIGURE WITH OVERRIDE to install it. 建议恢复间隔不要大于 60 分钟,并且默认情况下是不接受的。Recovery intervals greater than 60 minutes are not recommended and disallowed by default. 但是,由于指定了 WITH OVERRIDE 选项,因此 SQL ServerSQL Server 不会检查指定的值 (75) 是否为 recovery interval 配置选项的有效值。However, because the WITH OVERRIDE option is specified, SQL ServerSQL Server does not check whether the value specified (75) is a valid value for the recovery interval configuration option.

EXEC sp_configure 'recovery interval', 75    
RECONFIGURE WITH OVERRIDE;    
GO    

另请参阅See Also

服务器配置选项 (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)sp_configure (Transact-SQL)