[Microsoft][SQL Server Native Client 10.0]TCP 提供程序: 遠程主機強迫關閉了一個現有的連接。

遠程訪問數據庫報錯:

[Microsoft][SQL Server Native Client 10.0]TCP 提供程序: 遠程主機強迫關閉了一個現有的連接。

[Microsoft][SQL Server Native Client 10.0]通訊鏈接失敗

網上找了一堆文章照着做都沒有效果,後來請教微軟專家給的解決方案:

1、執行 exec sp_configure

2、查看remote login timeout (s) 設置時間是多少秒,一般默認爲10秒。

3、執行
GO
EXEC sp_configure 'remote login timeout', 35 ;
GO
RECONFIGURE ;
GO

變更爲35秒後觀察了一個月多月,再沒犯病。

最近啓用了一臺性能一般的數據庫服務器,用了上面的方法還是犯病,只能追加作業殺掉sleeping的進程了。

declare @s nvarchar(100)
declare tb cursor local
for
select N'kill '+rtrim(spid)  from sysprocesses where status='sleeping' and spid> =50 and  loginame !='需要保留的進程loginame'
open tb
fetch tb  into  @s
while  @@fetch_status=0
begin
exec(@s)
fetch tb into @s
end
close tb
deallocate tb

參考鏈接:https://docs.microsoft.com/zh-cn/previous-versions/sql/sql-server-2012/ms175136(v=sql.110)?redirectedfrom=MSDN

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章