正确理解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

相关内容

热门资讯

伊朗军队:已做好准备,坚决回击... 当地时间23日,伊朗军队发表声明,强调将随时准备对敌人的任何侵犯做出坚决且全方位的回击。(总台记者 ...
燃油车,真的没人买了? “如今加满一箱油,费用较年初高出近百元。”燃油车主张先生坦言,用车成本大幅上涨,让新能源车型的性价比...
出境打工月入3万?警惕境外高薪... 不要求学历和工作经验,到了国外就能找到工作,“月薪三万”“零门槛”“包吃住”,看到这样的广告,相信很...
格力空调外机嗡嗡响一下风机就不... 原因可能是制冷系统管路内发生制冷剂的缓慢渗漏,导致压缩机的工作效率骤减,内机末端装置风机盘管温度降低...
抽油烟机响了一下就不工作了 1、也许是因为插座的地方没有电了,或者油烟机的线路断掉了,出现了短路,所以油烟机不能正常的进行工作。...
冰箱搬运了一下就不制冷了 1、主要是因为搬运过程中电源线出现了拉扯导致电源线内部的线发生了断裂,所以再次使用的时候不再启动制冷...
冰箱调了温度之后就不启动了 原因可能是没有达到启动温度,可以尝试将档位调到最大看是否能正常启动;原因可能是外界气温较低时,室温与...
飞利浦电视开机闪一下就黑屏怎么... 1、检查插座的电压,确定是由于电源不稳定导致的,则需要在家里准备一个稳压器,保证供给电视的电压是稳定...
缅北“四大家族”多人被执行死刑... 2026年5月19日至22日,福建省泉州市中级人民法院一审公开开庭审理了被告人魏怀仁、廖景芳、康敏诈...
法国禁止以色列国家安全部长入境 新华社巴黎5月23日电 法国外交部长巴罗23日在社交媒体发文说,自即日起,以色列国家安全部长本-格维...