SQLSERVER服务器配置(一)

2014-11-24 13:28:57 · 作者: · 浏览: 1
SQLSERVER服务器配置
服务器配置选项
--启动AWE
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'awe enable',1--启动AWE选项,用于支持超过4G内存 具体用法见笔记三
go
sp_configure 'show advanced options',0
reconfigure
go
--指定SQL工作的最大工作线程
EXEC sys.sp_configure N'max worker threads', N'0'
GO
--指定SQL的windows优先级
EXEC sys.sp_configure N'priority boost', N'0'
GO
RECONFIGURE WITH OVERRIDE
GO
--指定游标集中的行数
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'cursor threshold'--指定游标集中的行数,超过此行数,将异步生成游标键集
go
sp_configure 'show advanced options',0
reconfigure
go
/*配置选项 'show advanced options' 已从 0 更改为 1。请运行 RECONFIGURE 语句进行安装。
name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
cursor threshold -1 2147483647 -1 -1
配置选项 'show advanced options' 已从 1 更改为 0。请运行 RECONFIGURE 语句进行安装。*/
--指定全文索引列的默认语言值
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'default full-text language'--2052代表简体中文,具体的查询联机丛书
go
sp_configure 'show advanced options',0
reconfigure
go
/*name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
default full-text language 0 2147483647 2052 2052*/
--控制是否让触发器返回结果集
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'disallow results from triggers',1--1代表on
go
sp_configure 'disallow results from triggers',0--0代表off
go
sp_configure 'show advanced options',0
reconfigure
go
/*配置选项 'disallow results from triggers' 已从 1 更改为 1。请运行 RECONFIGURE 语句进行安装。
配置选项 'disallow results from triggers' 已从 1 更改为 0。请运行 RECONFIGURE 语句进行安装。*/
--控制最初为创建索引分配的最大内存量
sp_configure 'index create memory', 4096
GO
--设置可用的锁的最大个数
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'locks'---要设置的话在后面加',数字'
go
sp_configure 'show advanced options',0
reconfigure
go
/*name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
locks 5000 2147483647 0 0
*/
--设置SQL进程可使用的工作线程数
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'max worker threads'--要设置的话在后面加',数字'
go
sp_configure 'show advanced options',0
reconfigure
go
max worker threads(A,RR)
128
32767
(对于 32 位 SQL Server,建议最大为 1024;对于 64 位 SQL Server,建议最大为 2048。)
0
归零操作将根据处理器的数量自动配置最大工作线程数,可以使用公式 (256+(<处理器数> -4)* 8) 来计算 32 位 SQL Server 的线程数,64 位 SQL Server 的线程数为 32 位的 2 倍。
/*name minimum maximum config_value run_value
----------------------------------- ----------- ----------- ------------ -----------
max worker threads 128 32767 0 0
*/
--指定一个查询在超时前等待所需资源的时间
sp_configure 'query wait',数字
go
--指定在SQL SERVER超时之前远程操作可以持续的时间
sp_configure 'remote query timeout',数字
go
--是否允许运行 系统存储过程xp_cmdshell
sp_configure 'show advanced options',1
reconfigure
go
sp_configure 'xp_cmdshell',1
reconfigure
go
sp_co