`
xys_777
  • 浏览: 204708 次
  • 性别: Icon_minigender_1
  • 来自: 大连
社区版块
存档分类
最新评论

[sql server] 服务器的设置

 
阅读更多

-- 1 内存篇

-- 设置使用 AWE 分配内存
EXEC sys.sp_configure N'awe enabled', N'1'
GO
RECONFIGURE WITH OVERRIDE

-- 设置最小服务器内存 50M
EXEC sys.sp_configure N'min server memory (MB)', N'50'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 设置最大服务器内存 2147483647M
EXEC sys.sp_configure N'max server memory (MB)', N'2147483647'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 创建索引占用的内存
EXEC sys.sp_configure N'index create memory (KB)', N'0'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 设置每次查询占用的最小内存
EXEC sys.sp_configure N'min memory per query (KB)', N'1024'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 2 cpu 篇

-- 设置 cpu 关联
EXEC sys.sp_configure N'affinity mask', N'1'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 设置 I/O 关联
EXEC sys.sp_configure N'affinity I/O mask', N'2'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 设置 cpu 最大线程
EXEC sys.sp_configure N'max worker threads', N'128'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 设置 cpu 最大线程
EXEC sys.sp_configure N'max worker threads', N'128'
GO
RECONFIGURE WITH OVERRIDE
GO

-- 提升 sql server 优先级
EXEC sys.sp_configure N'priority boost', N'1'
GO
RECONFIGURE WITH OVERRIDE
GO


-- 安全性篇

-- 修改服务器登陆验证模式 1-windows 身份验证模式;2-Sql Server 和 windows 身份验证模式
USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software/Microsoft/MSSQLServer/MSSQLServer', N'LoginMode', REG_DWORD, 1
GO

后续

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics