SQL Server 2008 R2 临时登录问题

SQL Server 2008 R2 临时登录问题

我们有一个成熟的 SQL Server 2008 R2 服务器,被许多 C# Web 应用程序使用,每个应用程序都具有连接池。

昨晚,所有 Web 应用程序都无法登录数据库,持续了 6 分钟,之后问题才得以解决。这涉及多种登录方式。

我查看了服务器上的事件日志,发现了很多类似的消息:

The client was unable to reuse a session with SPID [Various], which had been reset for connection pooling. The failure ID is 29. This error may have been caused by an earlier operation failing. Check the error logs for failed operations immediately before this error message.

我找不到错误消息前面的失败操作。失败 ID 29 显然是指RedoLoginException

事件日志中还有很多这样的内容:

Login failed for user '[Various]'. Reason: Failed to open the database configured in the login object while revalidating the login on the connection.

还有一些超时:

A timeout (30000 milliseconds) was reached while waiting for a transaction response from the MSSQLSERVER service.
Timeout occurred while waiting for latch: class 'DBCC_MULTIOBJECT_SCANNER' id ..., type 4, Task ...: 44, waittime 300, flags 0x1a, owning task .... Continuing to wait.
Timeout occurred while waiting for latch: class 'ACCESS_METHODS_DATASET_PARENT', ...

和:

IO Completion Listener (0x900) Worker ... appears to be non-yielding on Node 1. Approx CPU Used: kernel 0ms, user 0ms, Interval; 15334

从客户端 Web 服务器的角度来看,他们收到了许多登录错误:

Logon failure: the user has not been granted the requested logon type at this computer
Logon Failure: The target account name is incorrect
Logon failure: unknown user name or bad password

我对线程池感到疑惑,发现它max worker threads被设置为 0。

有任何想法吗?

更新:这种情况已发生过三次。

答案1

这很可能与客户端的连接方法和 MSSQL 的连接池有关。应用程序可能需要更新连接字符串,或者这是您整体设置中非常具体的事情。您可以在这里查看https://dba.stackexchange.com/questions/41820/connection-pools-being-reset-with-error-18056-severity-20-state-46-perfm

顺便说一句,如果您有 MSSQL 的具体错误描述,每个人都可以更轻松地给出答案。

希望这有帮助。

相关内容