配置 remote login timeout 服务器配置选项Configure the remote login timeout Server Configuration Option

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

本主题说明如何使用 SQL Server 2019SQL Server 2019 中配置 SQL Server Management StudioSQL Server Management Studio remote login timeout Transact-SQLTransact-SQL服务器配置选项。This topic describes how to configure the remote login timeout server configuration option in SQL Server 2019SQL Server 2019 by using SQL Server Management StudioSQL Server Management Studio or Transact-SQLTransact-SQL. remote login timeout 选项指定从登录远程服务器失败返回前等待的秒数。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. 例如,如果您尝试登录到一个远程服务器而该服务器已关闭, remote login timeout 帮助确保您在计算机停止登录尝试前不必无限期地等待下去。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. 此选项的默认值为 10 秒。The default value for this option is 10 seconds. 如果该值为 0,则允许无限期等待。A value of 0 allows for an infinite wait.

备注

此选项的默认值在 SQL Server 2008SQL Server 2008中为 20 秒。The default value for this option is 20 seconds in SQL Server 2008SQL Server 2008.

本主题内容In This Topic

开始之前Before You Begin

限制和局限Limitations and Restrictions

  • remote login timeout 选项影响与 OLE DB 访问接口之间为异类查询建立的连接。The remote login timeout option affects connections to OLE DB providers made for heterogeneous queries.

SecuritySecurity

权限Permissions

默认情况下,所有用户都具备不带参数或仅带第一个参数的 sp_configure 的执行权限。Execute permissions on sp_configure with no parameters or with only the first parameter are granted to all users by default. 若要执行带两个参数的 sp_configure 以更改配置选项或运行 RECONFIGURE 语句,则用户必须具备 ALTER SETTINGS 服务器级别的权限。To execute sp_configure with both parameters to change a configuration option or to run the RECONFIGURE statement, a user must be granted the ALTER SETTINGS server-level permission. ALTER SETTINGS 权限由 sysadminserveradmin 固定服务器角色隐式持有。The ALTER SETTINGS permission is implicitly held by the sysadmin and serveradmin fixed server roles.

使用 SQL Server Management StudioUsing SQL Server Management Studio

配置 remote login timeout 选项To configure the remote login timeout option

  1. 在对象资源管理器中,右键单击服务器并选择 “属性”In Object Explorer, right-click a server and select Properties.

  2. 单击 “高级” 节点。Click the Advanced node.

  3. “网络” 下,为 “远程登录超时值” 框选择一个值。Under Network, select a value for the Remote Login Timeout box.

    使用 remote login timeout 选项可以指定从远程登录失败返回前等待的秒数。Use the remote login timeout option to specify the number of seconds to wait before returning from a failed remote login attempt.

使用 Transact-SQLUsing Transact-SQL

配置 remote login timeout 选项To configure the remote login timeout option

  1. 连接到 数据库引擎Database EngineConnect to the 数据库引擎Database Engine.

  2. 在标准菜单栏上,单击 “新建查询”From the Standard bar, click New Query.

  3. 将以下示例复制并粘贴到查询窗口中,然后单击“执行” 。Copy and paste the following example into the query window and click Execute. 此示例说明如何使用 sp_configureremote login timeout 选项的值设置为 35 秒。This example shows how to use sp_configure to set the value of the remote login timeout option to 35 seconds.

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

有关详细信息,请参阅 服务器配置选项 (SQL Server)版本的组合自动配置的最大工作线程数。For more information, see Server Configuration Options (SQL Server).

跟进:在配置远程登录超时选项之后Follow Up: After you configure the remote login timeout option

该设置将立即生效,无需重新启动服务器。The setting takes effect immediately without restarting the server.

另请参阅See Also

RECONFIGURE (Transact-SQL) RECONFIGURE (Transact-SQL)
服务器配置选项 (SQL Server) Server Configuration Options (SQL Server)
sp_configure (Transact-SQL)sp_configure (Transact-SQL)