Setting Server Configuration Options
You can manage and optimize SQL Server resources through configuration options by using SQL Server Management Studio or the sp_configure system stored procedure. Some of these options can be configured using the SQL Server Surface Area Configuration tool. The most commonly used server configuration options are available through SQL Server Management Studio; all configuration options are accessible through sp_configure. Consider the effects on your system carefully before setting these options.
Important
Advanced options are those that should be changed only by an experienced database administrator or certified SQL Server technician.
Using the sp_configure System Stored Procedure
When using sp_configure, you must run either RECONFIGURE or RECONFIGURE WITH OVERRIDE after setting a configuration option. The RECONFIGURE WITH OVERRIDE statement is usually reserved for configuration options that should be used with extreme caution. However, RECONFIGURE WITH OVERRIDE works for all configuration options, and you can use it in place of RECONFIGURE.
Note
RECONFIGURE executes within a transaction. If any of the reconfigure operations fail, none of the reconfigure operations will take effect.
The value for each option can be determined with the following statement.
SELECT * FROM sys.configurations
ORDER BY name ;
GO
The following is an example of a script you can use with sp_configure
to change the fill factor
option from its default setting to a value of 100
:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'fill factor', 100;
GO
RECONFIGURE;
GO
Categories of Configuration Options
Configuration options take effect either:
- Immediately after setting the option and issuing the RECONFIGURE (or in some cases, RECONFIGURE WITH OVERRIDE) statement.
-or- - After performing the above actions and restarting the instance of SQL Server.
To configure an advanced option with sp_configure, you must first run sp_configure
with the 'show advanced options'
option set to 1
, and then run RECONFIGURE
:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'cursor threshold', 0;
GO
RECONFIGURE;
GO
In the previous example, reconfiguring the cursor threshold
option takes place immediately. The new value for cursor threshold
appears in the configuration options value_in_use column and the value column.
Options that require a restart of the instance of SQL Server will initially show the changed value only in the value column. After restart, the new value will appear in both the value column and the value_in_use column.
Some options require a server restart before the new configuration value takes effect. If you set the new value and run sp_configure before restarting the server, the new value appears in the configuration options value column, but not in the value_in_use column. After restarting the server, the new value appears in the value_in_use column.
Self-configuring options are those that SQL Server adjusts according to the needs of the system. In most cases, this eliminates the need for setting the values manually. Examples include the min server memory and max server memory options and the user connections option.
Configuration Options Table
The following table lists all available configuration options, the range of possible settings, and default values. Configuration options are marked with letter codes as follows:
A= Advanced options, which should be changed only by an experienced database administrator or a certified SQL Server technician, and which require setting show advanced options to 1.
RR = Options requiring a restart of the Database Engine.
SC = Self-configuring options.
Configuration option Minimum value Maximum value Default 0
1
0
affinity I/O mask (A, RR)
-2147483648
2147483647
0
affinity64 I/O mask (A, only available on 64-bit version of SQL Server)
-2147483648
2147483647
0
affinity mask (A)
-2147483648
2147483647
0
affinity64 mask (A, only available on 64-bit version of SQL Server)
-2147483648
2147483647
0
Agent XPs (A)
0
1
0
(Changes to 1 when SQL Server Agent is started. Will be 1 if SQL Server Agent is set to automatic start during setup.)
allow updates (Obsolete. Do not use. Will cause an error during reconfigure.)
0
1
0
awe enabled (A, RR)
0
1
0
0
86400
0
c2 audit mode (A, RR)
0
1
0
0
1
0
0
1
0
0
32767
5
0
1
0
cursor threshold (A)
-1
2147483647
-1
0
1
0
0
2147483647
1033
0
9999
0
0
1
1
0
1
0
fill factor (A, RR)
0
100
0
ft crawl bandwidth (max), see ft crawl bandwidth(A)
0
32767
100
ft crawl bandwidth (min), see ft crawl bandwidth(A)
0
32767
0
ft notify bandwidth (max), see ft notify bandwidth(A)
0
32767
100
ft notify bandwidth (min), see ft notify bandwidth(A)
0
32767
0
index create memory (A, SC)
704
2147483647
0
0
2
0
lightweight pooling (A, RR)
0
1
0
locks (A, RR, SC)
5000
2147483647
0
0
64
0
0
256
4
max server memory (A, SC)
16
2147483647
2147483647
0
2147483647
65536
max worker threads (A, RR)
128
32767
(1024 is the maximum recommended for 32-bit SQL Server, 2048 for 64-bit SQL Server.)
0
Zero auto-configures the number of max worker threads depending on the number of processors, using the formula (256+(<processors> -4) * 8) for 32-bit SQL Server and twice that for 64-bit SQL Server.
media retention (A, RR)
0
365
0
512
2147483647
1024
min server memory (A, SC)
0
2147483647
8
0
1
1
512
32767
4096
0
1
0
open objects (A, RR, obsolete)
0
2147483647
0
PH_timeout (A)
1
3600
60
precompute rank (A)
0
1
0
priority boost (A, RR)
0
1
0
0
2147483647
0
query wait (A)
-1
2147483647
-1
recovery interval (A, SC)
0
32767
0
remote access (RR)
0
1
1
0
1
0
0
2147483647
20
0
1
0
0
2147483647
600
0
1
0
scan for startup procs (A, RR)
0
1
0
0
1
1
set working set size (A, RR, obsolete)
0
1
0
0
1
0
SMO and DMO XPs (A)
0
1
1
SQL Mail XPs (A)
0
1
0
0
1
0
1753
9999
2049
user connections (A, RR, SC)
0
32767
0
User Instance Timeout (A, only appears in SQL Server 2005 Express Edition)
5
65535
60
user instances enabled (A, only appears in SQL Server 2005 Express Edition)
0
1
0
0
32767
0
0
1
0
xp_cmdshell (A)
0
1
0
See Also
Concepts
Other Resources
sp_configure (Transact-SQL)
RECONFIGURE (Transact-SQL)
Help and Information
Getting SQL Server 2005 Assistance
Change History
Release | History |
---|---|
12 December 2006 |
|
14 April 2006 |
|
5 December 2005 |
|