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

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


查看配置选项的设置

sp_configure

远程登录超时


参考: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.”

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”

时间: 2024-08-06 03:43:54

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

出现“在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。”这样的错误!

1.基本现象:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误.未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. 2. 可能出现的情况,拷贝了别人的项目,或者在网上找的别人的项目运行时附加到自己的数据库上,特别是在有版本差异的时候进行附加的时候,(比如:用SQL2005建的数据库,你附加在SQL2008的下面的时候)你需要修改项目中Web.Config文件中的数据库连接字符串,这时候你就需要注意了,根据不同版本的数据库,它的

连接数据库与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误,请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。

如果您的连接字符串是这样的 <add key="ConnectionString" value="server=127.0.0.1;database=NewsTest;uid=sa;pwd=***"/> 或者这样的 <add key="ConnectionString" value="server=local;database=NewsTest;uid=sa;pwd=***"/> 并且没有语法错误,建议

在与 SQL Serve2008r 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) j解决方案

在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误.未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. (provider: 命名管道提供程序, error: 40 - 无法打开到 SQL Server 的连接) 今早开机发现,打开SQL Server 2008 的 SQL Server Management Studio,输入sa的密码发现,无法登陆数据库?提示以下错误: “在与 SQL Server 建立连接时出现与网络相关

发生了 System.Data.SqlClient.SqlException HResult=0x80131904 Message=在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 -

刚刚一运行出现了这个错误,一看知道是数据库出问题了. 打开数据库,果然是这样. 标题: 连接到服务器 ------------------------------  无法连接到 ..  ------------------------------ 其他信息: 未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. 解决方法: 是没有连上实例~先点取消,在"查看"中选"已注册的服务器",展开"数据库引擎"

请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接)

程序异常,错误信息:在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误.未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. (provider: Named Pipes Provider, error: 40 - 无法打开到 SQL Server 的连接) 我今天也遇到这个问题了,解决了,首先确保你的MSSQLSERVER 内置账户是:Local System,如果不是就到Sql Server 配置管理器——Sql Server

未找到或无法访问服务器 请验证实例名称是否正确并且SQL Server 已配置为允许远程连接

无法连接到sql server 2008服务器 报下错误 其他信息    在与SQL Server建立连接时出现与网络相关的或特定于实例的错误 未找到或无法访问服务器请验证实例名称是否正确并且SQL Server 已配置为允许远程连接  provider :命名管道提供程序error:40 无法打开到SQL Server的链接  Microsoft SQL Server 错误2 解决方法: 打开SQL Server 配置管理器 查看SQL 是否在运行状态,如果不是运行需停止再启动,然后再连接就可

未找到或无法访问服务器。请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接。 error: 40 - 无法打开到 SQL Server 的连接

1.出现这种问题可能是您的sql是2005版的,没有支持sqlAgent服务,可尝试将服务器名称写为.\sqlexpress 使用windows身份登录,如图一所示. 2.登录成功后点安全性->登录名(右击)->新建登录名,如图2所示. 3.允许新用户登录,如图3所示.重新登录即可,如图4. 我因为这个原因被折磨了很久,希望能够帮到同样遇到困惑的人. 图1: 图2: 图3: 图4: 未找到或无法访问服务器.请验证实例名称是否正确并且 SQL Server 已配置为允许远程连接. error:

JeeSite如何正确连接SQL SERVER 数据库

JeeSite如何正确连接SQL SERVER 数据库 jeesite介绍 感谢jeesite项目的作者thinkgem. 没有你我也不会更改这数据源非了恁大的劲,,,,嘻嘻嘻说多了. JeeSite是基于多个优秀的开源项目,高度整合封装而成的高效,高性能,强安全性的开源Java EE快速开发平台. JeeSite是您快速完成项目的最佳基础平台解决方案,JeeSite是您想学习Java平台的最佳学习案例,JeeSite还是接私活的最佳助手. JeeSite是在Spring Framework基础

SQL数据同步到ELK(四)- 利用SQL SERVER Track Data相关功能同步数据(上)

一.相关文档 老规矩,为了避免我的解释误导大家,请大家务必通过官网了解一波SQL SERVER的相关功能. 文档地址: 整体介绍文档:https://docs.microsoft.com/en-us/sql/relational-databases/track-changes/about-change-tracking-sql-server?view=sql-server-2017 Change Data Capture:https://docs.microsoft.com/en-us/sql/