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

本文涉及的产品
云数据库 RDS SQL Server,基础系列 2核4GB
简介:

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



查看配置选项的设置

1
sp_configure

clip_image001

 

远程登录超时


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

clip_image003

1
2
3
4
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.

1
2
3
4
EXEC  sp_configure  'remote query timeout' , 0 ;
GO
RECONFIGURE ;
GO

 

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


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

1
2
3
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


















本文转自UltraSQL51CTO博客,原文链接: http://blog.51cto.com/ultrasql/1863914,如需转载请自行联系原作者




相关文章
|
26天前
|
SQL 监控 关系型数据库
查寻MySQL或SQL Server的连接数,并配置超时时间和最大连接量
以上步骤提供了直观、实用且易于理解且执行的指导方针来监管和优化数据库服务器配置。务必记得,在做任何重要变更前备份相关配置文件,并确保理解每个参数对系统性能可能产生影响后再做出调节。
170 11
|
2月前
|
SQL XML Java
配置Spring框架以连接SQL Server数据库
最后,需要集成Spring配置到应用中,这通常在 `main`方法或者Spring Boot的应用配置类中通过加载XML配置或使用注解来实现。
270 0
|
8月前
|
SQL Oracle 关系型数据库
如何在 Oracle 中配置和使用 SQL Profiles 来优化查询性能?
在 Oracle 数据库中,SQL Profiles 是优化查询性能的工具,通过提供额外统计信息帮助生成更有效的执行计划。配置和使用步骤包括:1. 启用自动 SQL 调优;2. 手动创建 SQL Profile,涉及收集、执行调优任务、查看报告及应用建议;3. 验证效果;4. 使用 `DBA_SQL_PROFILES` 视图管理 Profile。
|
关系型数据库 MySQL 网络安全
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
5-10Can't connect to MySQL server on 'sh-cynosl-grp-fcs50xoa.sql.tencentcdb.com' (110)")
|
SQL XML Java
mybatis :sqlmapconfig.xml配置 ++++Mapper XML 文件(sql/insert/delete/update/select)(增删改查)用法
当然,这些仅是MyBatis功能的初步介绍。MyBatis还提供了高级特性,如动态SQL、类型处理器、插件等,可以进一步提供对数据库交互的强大支持和灵活性。希望上述内容对您理解MyBatis的基本操作有所帮助。在实际使用中,您可能还需要根据具体的业务要求调整和优化SQL语句和配置。
193 1
|
11月前
|
SQL BI 网络安全
SQL Server2014的安装与配置
SQL Server2014的安装与配置
542 0
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
181 6
|
SQL Java 数据库连接
idea中配置mybatis 映射文件模版及 mybatis plus 自定义sql
idea中配置mybatis 映射文件模版及 mybatis plus 自定义sql
430 3
|
SQL 安全 Java
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
1048 0
|
SQL 存储 关系型数据库
SQL安装实战:从零开始,一步步掌握SQL数据库的安装与配置
配置SQL数据库以优化性能 安装完成后,接下来的任务是对SQL数据库进行必要的配置,以确保其能够顺利运行并满足你的性能需求。以下是一些关键的配置步骤: