正确理解SQL Server配置timeout相关选项
admin
2023-06-04 22:01:14
0

正确理解SQL Server配置选项“remote login timeout”和“remote query timeout



查看配置选项的设置

sp_configure

正确理解SQL Server配置timeout相关选项

 

远程登录超时


参考:https://msdn.microsoft.com/en-us/library/ms175136.aspx


“The remote login timeout option specifies the number of seconds to wait before returning from a failed attempt to log in to a remote server. For example, if you are trying to log in to a remote server and that server is down, remote login timeout helps make sure that you do not have to wait indefinitely before your computer stops trying to log in. The default value for this option is 10 seconds. A value of 0 allows for an infinite wait.

The default value for this option is 20 seconds in SQL Server 2008.

The remote login timeout option affects connections to OLE DB providers made for heterogeneous queries.

The setting takes effect immediately without restarting the server.”

正确理解SQL Server配置timeout相关选项

EXEC sp_configure 'remote login timeout', 35 ;
GO
RECONFIGURE ;
GO

 

远程查询超时


参考:https://msdn.microsoft.com/en-us/library/ms189040.aspx


“The remote query timeout option specifies how long, in seconds, a remote operation can take before SQL Server times out. The default value for this option is 600, which allows a 10-minute wait. This value applies to an outgoing connection initiated by the Database Engine as a remote query. This value has no effect on queries received by the Database Engine. To disable the time-out, set the value to 0. A query will wait until it is canceled.

For heterogeneous queries, remote query timeout specifies the number of seconds (initialized in the command object using the DBPROP_COMMANDTIMEOUT rowset property) that a remote provider should wait for result sets before the query times out. This value is also used to set DBPROP_GENERALTIMEOUT if supported by the remote provider. This will cause any other operations to time out after the specified number of seconds.

For remote stored procedures, remote query timeout specifies the number of seconds that must elapse after sending a remote EXEC statement before the remote stored procedure times out.

The setting takes effect immediately without restarting the server.

EXEC sp_configure 'remote query timeout', 0 ;
GO
RECONFIGURE ;
GO

 

远程服务器和链接服务器的对应选项


参考:https://msdn.microsoft.com/en-us/library/ms178532.aspx

sp_serveroption [@server = ] 'server'
,[@optname = ] 'option_name'
,[@optvalue = ] 'option_value' ;


connect timeout

Time-out valuein seconds for connecting to a linked server.            
If 0, use the sp_configure default.

query timeout

Time-out value for queries against a linked server.            
If 0, use the sp_configure default.



我只简单解释一句,这几个选项只是针对“outgoing connections

相关内容

热门资讯

美国打压进口多晶硅,中使馆回应 【环球时报报道 记者 倪浩 尹野平】当地时间8月6日,美国总统特朗普签署行政令,依据《1962年贸易...
历史性一天,给美国的一个强烈信... 对中东来说,这是历史性的一天。沙特王储萨勒曼、土耳其总统埃尔多安、巴基斯坦总理夏巴兹,8月7日在沙特...
美参议院法案拟对中印加税100... 据美国消费者新闻与商业频道(CNBC)8月7日报道,美国参议院周五以压倒性优势通过了一项对俄罗斯制裁...
华为×Les Néréides... IT之家 8 月 7 日消息,华为终端 BG CEO 何刚今日宣布,FreeClip 2 耳夹耳机配...
2026年正规的手机取卡针品控... 现在手机数码行业更新迭代速度越来越快,终端品牌对供应链配套的要求也越来越高,一个小小的手机取卡针,虽...
预计“白海豚”明晚将在浙江舟山... 今天6时中央气象台发布台风橙色预警和强对流天气蓝色预警。台风橙色预警今年第13号台风“白海豚”(强台...
谷歌AI业务重组幕后:商业化压... 财联社8月7日讯(编辑 史正丞)本周早些时候, 美国互联网巨头谷歌宣布对旗下AI业务展开全面洗牌。D...
喜报!古田一小斩获全国青少年无... 近日,第十届全国青少年无人机大赛总决赛在天津收官。古田县第一小学慈育雏鹰基地无人机社团6名学子,在基...
加媒:加拿大正与美国商讨,以贸... 据加拿大《环球邮报》8月7日消息,知情人士称,加拿大和美国正在讨论一项潜在协议。根据该协议,渥太华将...
德意电器油烟机怎么样,口碑好吗 最佳回答 你好,得意的抽油烟机虽然不怎么做广告,但是人家很牛啊,不做广告,我的价格依然很高,关键是,...