sql server

sqlserver调优时可能回需要如下参数查询,记录如下:

1. 查询最大连接数

SELECT value_in_use
FROM sys.configurations c
WHERE c.name = 'user connections'; 

默认值为:0,即无限制。

2. 查询当前连接数

select count(distinct(login_time)) from sys.sysprocesses 

3. 设置最大连接数

exec sp_configure 'show advanced options', 1 
GO

RECONFIGURE WITH OVERRIDE
GO

exec sp_configure 'user connections', 300
GO

RECONFIGURE WITH OVERRIDE
GO

设置过后需要重启数据库才会生效。

4、设置最大超时时间

sp_configure  'show  advanced  options',  1  
GO  
RECONFIGURE  
GO  
sp_configure  'query  wait',  2147483647  
GO  
RECONFIGURE  
GO  

其它可参考:https://blog.csdn.net/wstoneh01/article/details/50596386

发布了30 篇原创文章 · 获赞 4 · 访问量 7万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章