分享今天在客户那里遇到的SQLSERVER连接超时以及我的解决办法

浏览: 2481

客户的环境:SQLSERVER2005,WINDOWS2003 SP2  32位

这次发生连接超时的时间是2013-8-5  21:34分

2013-8-5  19:25分左右也发生过一次

下面的SQL ERRORLOG截取的是19:18分~22:08分时间段之内的关键日志!!!

这个问题昨天出现了一次,今天出现了两次,起初没有认真对待,认为重启一下机器就没事了

我认为是CPU占用高或者内存占用高或者磁盘读写高,因为客户的机器安装了360安全卫士,

当时客户反映360安全卫士报“磁盘读写高”

因为我当时看了任务管理器,windows日志,各项信息都很正常,CPU占用在30%左右,内存在800MB左右

360那里也没有看出磁盘读写特别高(注意:当时我是在客户重启了机器之后看的!!!!!!!!!!!!)

-------------------------------------华丽的分割线-----------------------------

入手

谁知道今晚又出现第三次,使得我要从酒店又跑回客户那里

我去到客户那里第一时间先看windows日志和sql errorlog

由于在SQL ERRORLOG里看到很多想尝试登陆数据库而失败的日志,

而且看到Windows eventlog里有好几次SQL服务意外关闭

的记录,但是SQLSERVER是没有shutdown 电脑的SQL语句的,所以肯定不是外人所为

而且连接超时也不是经常出现,所以排除了黑客捣蛋的可能性(客户的电脑设置了防火墙,sa用户禁用,路由器只开了1433端口)

电脑也做了一些安全设置

 

不过SQLSERVER有停止Microsoft SQL server的命令

下面两个SQL语句都可以用来停止SQLSERVER

1 SHUTDOWN  
2 SHUTDOWN WITH NOWAIT

不过如果运行上面两个语句,在SQL ERRORLOG里会有相应的日志记录的

1 2013-11-30 00:09:42.89 spid12s     Service Broker manager has shut down.
2 2013-11-30 00:09:42.94 spid54 Server shut down by request from login JOE\Administrator.
3 2013-11-30 00:09:42.94 spid54 SQL Trace was stopped due to server shutdown. Trace ID = '2'. This is an informational message only; no user action is required.
4 2013-11-30 00:09:42.94 spid54 SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
5 2013-11-30 00:09:43.87 登录 错误: 17188,严重性: 16,状态: 1
6 2013-11-30 00:09:43.87 登录 SQL Server cannot accept new connections, because it is shutting down. The connection has been closed. [客户端: <local machine>]
7 2013-11-30 00:09:43.87 登录 错误: 17188,严重性: 16,状态: 1
8 2013-11-30 00:09:43.87 登录 SQL Server cannot accept new connections, because it is shutting down. The connection has been closed. [客户端: <local machine>]

 

1 2013-11-30 00:14:19.99 spid52      Server shut down by NOWAIT request from login JOE\Administrator.
2 2013-11-30 00:14:19.99 spid52 SQL Trace was stopped due to server shutdown. Trace ID = '2'. This is an informational message only; no user action is required.
3 2013-11-30 00:14:19.99 spid52 SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

2013-11-30 00:09:42.94 spid54      Server shut down by request from login JOE\Administrator.

2013-11-30 00:14:19.99 spid52      Server shut down by NOWAIT request from login JOE\Administrator.

通过SQL语句来shundownSQLSERVER在错误日志里会显示上面两条记录

 

 

但是这次的shutdown记录是

SQL Server is terminating because of a system shutdown.

----------------------------------华丽的分割线-------------------------------

再仔细分析

由于我们的应用系统其中一个是用delphi写的,而且用ODBC来连接SQLSERVER,而且这个应用

是一打开就马上open connection,直到退出这个应用为止,不像C# 执行完毕就close()

所以如果这个应用断开与数据库的连接就会影响到客户的业务运行,当时操作系统弹出“超时对话框”的时候

点击我们的系统很慢几乎没有反应,响应很迟钝,我重启电脑,看一下windows日志

我在客户的机器里截了一些图片

再看一下SQL ERRORLOG

下面这个是重启电脑之后,SQLSERVER启动的SQLERRORLOG

 1 2013-08-05 19:18:09.24 Server      Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) 
2 Dec 10 2010 10:56:29
3 Copyright (c) 1988-2005 Microsoft Corporation
4 Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
5
6 2013-08-05 19:18:09.31 Server (c) 2005 Microsoft Corporation.
7 2013-08-05 19:18:09.31 Server All rights reserved.
8 2013-08-05 19:18:09.31 Server Server process ID is 2744.
9 2013-08-05 19:18:09.33 Server Authentication mode is MIXED.
10 2013-08-05 19:18:09.33 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
11 2013-08-05 19:18:09.33 Server This instance of SQL Server last reported using a process ID of 888 at 2013-8-5 19:17:27 (local) 2013-8-5 11:17:27 (UTC). This is an informational message only; no user action is required.
12 2013-08-05 19:18:09.33 Server Registry startup parameters:
13 2013-08-05 19:18:09.33 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
14 2013-08-05 19:18:09.33 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
15 2013-08-05 19:18:09.33 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
16 2013-08-05 19:18:09.36 服务器 SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
17 2013-08-05 19:18:09.36 服务器 Detected 2 CPUs. This is an informational message; no user action is required.
18 2013-08-05 19:18:09.73 服务器 Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
19 2013-08-05 19:18:10.05 服务器 Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
20 2013-08-05 19:18:10.39 服务器 The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
21 2013-08-05 19:18:10.46 服务器 Database mirroring has been enabled on this instance of SQL Server.
22 2013-08-05 19:18:10.56 spid5s Starting up database 'master'.
23 2013-08-05 19:18:10.69 spid5s 33 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
24 2013-08-05 19:18:10.74 spid5s 0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
25 2013-08-05 19:18:10.74 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
26 2013-08-05 19:18:10.88 spid5s Starting up database 'mssqlsystemresource'.
27 2013-08-05 19:18:10.92 spid5s The resource database build version is 9.00.5000. This is an informational message only. No user action is required.
28 2013-08-05 19:18:11.18 spid5s Server name is 'HS'. This is an informational message only. No user action is required.
29 2013-08-05 19:18:11.20 spid8s Starting up database 'model'.
30 2013-08-05 19:18:11.42 spid8s Clearing tempdb database.
31 2013-08-05 19:18:12.12 spid8s Starting up database 'tempdb'.
32 2013-08-05 19:18:12.34 spid11s The Service Broker protocol transport is disabled or not configured.
33 2013-08-05 19:18:12.34 spid11s The Database Mirroring protocol transport is disabled or not configured.
34 2013-08-05 19:18:12.38 spid11s Service Broker manager has started.
35 2013-08-05 19:18:12.60 服务器 A self-generated certificate was successfully loaded for encryption.
36 2013-08-05 19:18:12.62 服务器 Server is listening on [ 'any' <ipv4> 1433].
37 2013-08-05 19:18:12.62 服务器 Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
38 2013-08-05 19:18:12.62 服务器 Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
39 2013-08-05 19:18:12.64 服务器 Server is listening on [ 'any' <ipv4> 1434].
40 2013-08-05 19:18:12.64 服务器 Dedicated admin connection support was established for listening remotely on port 1434.
41 2013-08-05 19:18:12.70 服务器 The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
42 2013-08-05 19:18:12.70 服务器 SQL Server is now ready for client connections. This is an informational message; no user action is required.
43 2013-08-05 19:18:13.23 spid14s Starting up database 'msdb'.
44 2013-08-05 19:18:13.23 spid15s Starting up database 'GPOSDB'.
45 2013-08-05 19:18:14.31 spid14s 25 transactions rolled forward in database 'msdb' (4). This is an informational message only. No user action is required.
46 2013-08-05 19:18:14.78 spid5s 0 transactions rolled back in database 'msdb' (4). This is an informational message only. No user action is required.
47 2013-08-05 19:18:14.78 spid5s Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
48 2013-08-05 19:18:19.86 spid15s Analysis of database 'GPOSDB' (5) is 5% complete (approximately 4 seconds remain). This is an informational message only. No user action is required.
49 2013-08-05 19:18:23.85 spid15s Analysis of database 'GPOSDB' (5) is 82% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
50 2013-08-05 19:18:24.88 spid15s Analysis of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
51 2013-08-05 19:18:24.88 spid15s Recovery of database 'GPOSDB' (5) is 0% complete (approximately 261 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
52 2013-08-05 19:18:25.02 spid15s Recovery of database 'GPOSDB' (5) is 1% complete (approximately 7 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
53 2013-08-05 19:18:30.50 spid15s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
54 2013-08-05 19:18:30.50 spid15s 214 transactions rolled forward in database 'GPOSDB' (5). This is an informational message only. No user action is required.
55 2013-08-05 19:18:30.61 spid15s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
56 2013-08-05 19:18:30.71 spid5s Recovery of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
57 2013-08-05 19:18:30.71 spid5s 0 transactions rolled back in database 'GPOSDB' (5). This is an informational message only. No user action is required.
58 2013-08-05 19:18:30.71 spid5s Recovery is writing a checkpoint in database 'GPOSDB' (5). This is an informational message only. No user action is required.
59 2013-08-05 19:18:30.73 spid5s Recovery is complete. This is an informational message only. No user action is required.
60 2013-08-05 19:18:31.64 spid51 Using 'xpstar90.dll' version '2005.90.5000' to execute extended stored procedure 'xp_sqlagent_monitor'. This is an informational message only; no user action is required.

下面这个是电脑正常重启的时候的SQL ERRORLOG

  1 2013-08-05 21:59:51.28 Server      Microsoft SQL Server 2005 - 9.00.5000.00 (Intel X86) 
2 Dec 10 2010 10:56:29
3 Copyright (c) 1988-2005 Microsoft Corporation
4 Enterprise Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
5
6 2013-08-05 21:59:51.28 Server (c) 2005 Microsoft Corporation.
7 2013-08-05 21:59:51.28 Server All rights reserved.
8 2013-08-05 21:59:51.28 Server Server process ID is 1228.
9 2013-08-05 21:59:51.28 Server Authentication mode is MIXED.
10 2013-08-05 21:59:51.28 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
11 2013-08-05 21:59:51.28 Server This instance of SQL Server last reported using a process ID of 3700 at 2013-8-5 21:58:42 (local) 2013-8-5 13:58:42 (UTC). This is an informational message only; no user action is required.
12 2013-08-05 21:59:51.28 Server Registry startup parameters:
13 2013-08-05 21:59:51.28 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
14 2013-08-05 21:59:51.28 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
15 2013-08-05 21:59:51.28 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
16 2013-08-05 21:59:51.37 服务器 SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
17 2013-08-05 21:59:51.39 服务器 Detected 2 CPUs. This is an informational message; no user action is required.
18 2013-08-05 21:59:53.82 服务器 Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
19 2013-08-05 21:59:53.89 服务器 Attempting to initialize Microsoft Distributed Transaction Coordinator (MS DTC). This is an informational message only. No user action is required.
20 2013-08-05 21:59:53.90 服务器 The Microsoft Distributed Transaction Coordinator (MS DTC) service could not be contacted. If you would like distributed transaction functionality, please start this service.
21 2013-08-05 21:59:53.90 服务器 Database mirroring has been enabled on this instance of SQL Server.
22 2013-08-05 21:59:53.91 spid5s Starting up database 'master'.
23 2013-08-05 21:59:54.34 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
24 2013-08-05 21:59:54.93 spid5s Starting up database 'mssqlsystemresource'.
25 2013-08-05 21:59:55.24 spid5s The resource database build version is 9.00.5000. This is an informational message only. No user action is required.
26 2013-08-05 21:59:55.68 spid5s Server name is 'HS'. This is an informational message only. No user action is required.
27 2013-08-05 21:59:55.68 spid8s Starting up database 'model'.
28 2013-08-05 21:59:56.09 服务器 A self-generated certificate was successfully loaded for encryption.
29 2013-08-05 21:59:56.10 服务器 Server is listening on [ 'any' <ipv4> 1433].
30 2013-08-05 21:59:56.10 服务器 Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
31 2013-08-05 21:59:56.10 服务器 Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
32 2013-08-05 21:59:56.10 服务器 Server is listening on [ 'any' <ipv4> 1434].
33 2013-08-05 21:59:56.10 服务器 Dedicated admin connection support was established for listening remotely on port 1434.
34 2013-08-05 21:59:56.10 服务器 The SQL Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies.
35 2013-08-05 21:59:56.11 服务器 SQL Server is now ready for client connections. This is an informational message; no user action is required.
36 2013-08-05 21:59:56.13 spid11s Starting up database 'msdb'.
37 2013-08-05 21:59:56.13 spid12s Starting up database 'GPOSDB'.
38 2013-08-05 21:59:56.67 spid8s Clearing tempdb database.
39 2013-08-05 22:00:24.12 spid8s Starting up database 'tempdb'.
40 2013-08-05 22:00:33.17 spid5s Recovery is complete. This is an informational message only. No user action is required.
41 2013-08-05 22:00:33.17 spid11s The Service Broker protocol transport is disabled or not configured.
42 2013-08-05 22:00:33.17 spid11s The Database Mirroring protocol transport is disabled or not configured.
43 2013-08-05 22:00:33.30 spid11s Service Broker manager has started.
44 2013-08-05 22:00:42.62 spid51 Using 'xpsqlbot.dll' version '2005.90.5000' to execute extended stored procedure 'xp_qv'. This is an informational message only; no user action is required.
45 2013-08-05 22:00:45.54 spid51 Using 'xpstar90.dll' version '2005.90.5000' to execute extended stored procedure 'xp_instance_regread'. This is an informational message only; no user action is required.
46 2013-08-05 22:00:47.02 spid51 Using 'xplog70.dll' version '2005.90.5000' to execute extended stored procedure 'xp_msver'. This is an informational message only; no user action is required.
47 2013-08-05 22:05:43.46 登录 错误: 18456,严重性: 14,状态: 7
48 2013-08-05 22:05:43.46 登录 Login failed for user 'sa'. [客户端: 211.149.156.95]
49 2013-08-05 22:07:25.21 登录 错误: 18456,严重性: 14,状态: 7
50 2013-08-05 22:07:25.21 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
51 2013-08-05 22:07:25.31 登录 错误: 18456,严重性: 14,状态: 7
52 2013-08-05 22:07:25.31 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
53 2013-08-05 22:07:25.40 登录 错误: 18456,严重性: 14,状态: 7
54 2013-08-05 22:07:25.40 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
55 2013-08-05 22:07:29.17 登录 错误: 18456,严重性: 14,状态: 7
56 2013-08-05 22:07:29.17 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
57 2013-08-05 22:07:29.26 登录 错误: 18456,严重性: 14,状态: 7
58 2013-08-05 22:07:29.26 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
59 2013-08-05 22:07:32.26 登录 错误: 18456,严重性: 14,状态: 7
60 2013-08-05 22:07:32.26 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
61 2013-08-05 22:07:32.35 登录 错误: 18456,严重性: 14,状态: 7
62 2013-08-05 22:07:32.35 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
63 2013-08-05 22:07:32.45 登录 错误: 18456,严重性: 14,状态: 7
64 2013-08-05 22:07:32.45 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
65 2013-08-05 22:07:32.54 登录 错误: 18456,严重性: 14,状态: 7
66 2013-08-05 22:07:32.54 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
67 2013-08-05 22:07:32.63 登录 错误: 18456,严重性: 14,状态: 7
68 2013-08-05 22:07:32.63 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
69 2013-08-05 22:07:32.73 登录 错误: 18456,严重性: 14,状态: 7
70 2013-08-05 22:07:32.73 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
71 2013-08-05 22:07:32.82 登录 错误: 18456,严重性: 14,状态: 7
72 2013-08-05 22:07:32.82 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
73 2013-08-05 22:07:32.91 登录 错误: 18456,严重性: 14,状态: 7
74 2013-08-05 22:07:32.91 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
75 2013-08-05 22:07:33.00 登录 错误: 18456,严重性: 14,状态: 7
76 2013-08-05 22:07:33.00 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
77 2013-08-05 22:07:33.09 登录 错误: 18456,严重性: 14,状态: 7
78 2013-08-05 22:07:33.09 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
79 2013-08-05 22:07:33.19 登录 错误: 18456,严重性: 14,状态: 7
80 2013-08-05 22:07:33.19 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
81 2013-08-05 22:07:33.28 登录 错误: 18456,严重性: 14,状态: 7
82 2013-08-05 22:07:33.28 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
83 2013-08-05 22:07:33.37 登录 错误: 18456,严重性: 14,状态: 7
84 2013-08-05 22:07:33.37 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
85 2013-08-05 22:07:36.42 登录 错误: 18456,严重性: 14,状态: 7
86 2013-08-05 22:07:36.42 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
87 2013-08-05 22:07:36.51 登录 错误: 18456,严重性: 14,状态: 7
88 2013-08-05 22:07:36.51 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
89 2013-08-05 22:07:36.60 登录 错误: 18456,严重性: 14,状态: 7
90 2013-08-05 22:07:36.60 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
91 2013-08-05 22:07:36.69 登录 错误: 18456,严重性: 14,状态: 7
92 2013-08-05 22:07:36.69 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
93 2013-08-05 22:07:42.65 登录 错误: 18456,严重性: 14,状态: 7
94 2013-08-05 22:07:42.65 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
95 2013-08-05 22:07:42.74 登录 错误: 18456,严重性: 14,状态: 7
96 2013-08-05 22:07:42.74 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
97 2013-08-05 22:07:42.84 登录 错误: 18456,严重性: 14,状态: 7
98 2013-08-05 22:07:42.84 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
99 2013-08-05 22:07:42.93 登录 错误: 18456,严重性: 14,状态: 7
100 2013-08-05 22:07:42.93 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
101 2013-08-05 22:07:43.02 登录 错误: 18456,严重性: 14,状态: 7
102 2013-08-05 22:07:43.02 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
103 2013-08-05 22:07:43.11 登录 错误: 18456,严重性: 14,状态: 7
104 2013-08-05 22:07:43.11 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
105 2013-08-05 22:07:43.21 登录 错误: 18456,严重性: 14,状态: 7
106 2013-08-05 22:07:43.21 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
107 2013-08-05 22:07:43.30 登录 错误: 18456,严重性: 14,状态: 7
108 2013-08-05 22:07:43.30 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
109 2013-08-05 22:07:43.39 登录 错误: 18456,严重性: 14,状态: 7
110 2013-08-05 22:07:43.39 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
111 2013-08-05 22:07:43.48 登录 错误: 18456,严重性: 14,状态: 7
112 2013-08-05 22:07:43.48 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
113 2013-08-05 22:07:43.58 登录 错误: 18456,严重性: 14,状态: 7
114 2013-08-05 22:07:43.58 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
115 2013-08-05 22:07:43.67 登录 错误: 18456,严重性: 14,状态: 7
116 2013-08-05 22:07:43.67 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
117 2013-08-05 22:07:46.64 登录 错误: 18456,严重性: 14,状态: 7
118 2013-08-05 22:07:46.64 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
119 2013-08-05 22:07:49.73 登录 错误: 18456,严重性: 14,状态: 7
120 2013-08-05 22:07:49.73 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
121 2013-08-05 22:07:49.82 登录 错误: 18456,严重性: 14,状态: 7
122 2013-08-05 22:07:49.82 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
123 2013-08-05 22:07:49.92 登录 错误: 18456,严重性: 14,状态: 7
124 2013-08-05 22:07:49.92 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
125 2013-08-05 22:07:50.01 登录 错误: 18456,严重性: 14,状态: 7
126 2013-08-05 22:07:50.01 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
127 2013-08-05 22:07:50.10 登录 错误: 18456,严重性: 14,状态: 7
128 2013-08-05 22:07:50.10 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
129 2013-08-05 22:07:50.19 登录 错误: 18456,严重性: 14,状态: 7
130 2013-08-05 22:07:50.19 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
131 2013-08-05 22:07:50.29 登录 错误: 18456,严重性: 14,状态: 7
132 2013-08-05 22:07:50.29 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
133 2013-08-05 22:07:50.38 登录 错误: 18456,严重性: 14,状态: 7
134 2013-08-05 22:07:50.38 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
135 2013-08-05 22:07:50.47 登录 错误: 18456,严重性: 14,状态: 7
136 2013-08-05 22:07:50.47 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
137 2013-08-05 22:07:50.56 登录 错误: 18456,严重性: 14,状态: 7
138 2013-08-05 22:07:50.56 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
139 2013-08-05 22:07:50.66 登录 错误: 18456,严重性: 14,状态: 7
140 2013-08-05 22:07:50.66 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
141 2013-08-05 22:07:50.75 登录 错误: 18456,严重性: 14,状态: 7
142 2013-08-05 22:07:50.75 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
143 2013-08-05 22:07:50.84 登录 错误: 18456,严重性: 14,状态: 7
144 2013-08-05 22:07:50.84 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
145 2013-08-05 22:07:50.93 登录 错误: 18456,严重性: 14,状态: 7
146 2013-08-05 22:07:50.93 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
147 2013-08-05 22:07:51.03 登录 错误: 18456,严重性: 14,状态: 7
148 2013-08-05 22:07:51.03 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
149 2013-08-05 22:07:51.12 登录 错误: 18456,严重性: 14,状态: 7
150 2013-08-05 22:07:51.12 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
151 2013-08-05 22:07:51.21 登录 错误: 18456,严重性: 14,状态: 7
152 2013-08-05 22:07:51.21 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
153 2013-08-05 22:07:53.91 登录 错误: 18456,严重性: 14,状态: 7
154 2013-08-05 22:07:53.91 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
155 2013-08-05 22:07:54.00 登录 错误: 18456,严重性: 14,状态: 7
156 2013-08-05 22:07:54.00 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
157 2013-08-05 22:07:54.09 登录 错误: 18456,严重性: 14,状态: 7
158 2013-08-05 22:07:54.09 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
159 2013-08-05 22:07:54.18 登录 错误: 18456,严重性: 14,状态: 7
160 2013-08-05 22:07:54.18 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
161 2013-08-05 22:07:54.28 登录 错误: 18456,严重性: 14,状态: 7
162 2013-08-05 22:07:54.28 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
163 2013-08-05 22:07:54.37 登录 错误: 18456,严重性: 14,状态: 7
164 2013-08-05 22:07:54.37 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
165 2013-08-05 22:07:54.46 登录 错误: 18456,严重性: 14,状态: 7
166 2013-08-05 22:07:54.46 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
167 2013-08-05 22:07:54.55 登录 错误: 18456,严重性: 14,状态: 7
168 2013-08-05 22:07:54.55 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
169 2013-08-05 22:07:54.65 登录 错误: 18456,严重性: 14,状态: 7
170 2013-08-05 22:07:54.65 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
171 2013-08-05 22:07:54.74 登录 错误: 18456,严重性: 14,状态: 7
172 2013-08-05 22:07:54.74 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
173 2013-08-05 22:07:54.83 登录 错误: 18456,严重性: 14,状态: 7
174 2013-08-05 22:07:54.83 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
175 2013-08-05 22:07:54.92 登录 错误: 18456,严重性: 14,状态: 7
176 2013-08-05 22:07:54.92 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
177 2013-08-05 22:07:57.96 登录 错误: 18456,严重性: 14,状态: 7
178 2013-08-05 22:07:57.96 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
179 2013-08-05 22:07:58.06 登录 错误: 18456,严重性: 14,状态: 7
180 2013-08-05 22:07:58.06 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
181 2013-08-05 22:08:01.45 登录 错误: 18456,严重性: 14,状态: 7
182 2013-08-05 22:08:01.45 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
183 2013-08-05 22:08:01.54 登录 错误: 18456,严重性: 14,状态: 7
184 2013-08-05 22:08:01.54 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
185 2013-08-05 22:08:01.63 登录 错误: 18456,严重性: 14,状态: 7
186 2013-08-05 22:08:01.63 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
187 2013-08-05 22:08:01.73 登录 错误: 18456,严重性: 14,状态: 7
188 2013-08-05 22:08:01.73 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
189 2013-08-05 22:08:01.82 登录 错误: 18456,严重性: 14,状态: 7
190 2013-08-05 22:08:01.82 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
191 2013-08-05 22:08:01.91 登录 错误: 18456,严重性: 14,状态: 7
192 2013-08-05 22:08:01.91 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
193 2013-08-05 22:08:05.01 登录 错误: 18456,严重性: 14,状态: 7
194 2013-08-05 22:08:05.01 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
195 2013-08-05 22:08:05.10 登录 错误: 18456,严重性: 14,状态: 7
196 2013-08-05 22:08:05.10 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
197 2013-08-05 22:08:05.20 登录 错误: 18456,严重性: 14,状态: 7
198 2013-08-05 22:08:05.20 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
199 2013-08-05 22:08:05.29 登录 错误: 18456,严重性: 14,状态: 7
200 2013-08-05 22:08:05.29 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
201 2013-08-05 22:08:05.38 登录 错误: 18456,严重性: 14,状态: 7
202 2013-08-05 22:08:05.38 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
203 2013-08-05 22:08:05.47 登录 错误: 18456,严重性: 14,状态: 7
204 2013-08-05 22:08:05.47 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
205 2013-08-05 22:08:05.56 登录 错误: 18456,严重性: 14,状态: 7
206 2013-08-05 22:08:05.56 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
207 2013-08-05 22:08:05.66 登录 错误: 18456,严重性: 14,状态: 7
208 2013-08-05 22:08:05.66 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
209 2013-08-05 22:08:05.75 登录 错误: 18456,严重性: 14,状态: 7
210 2013-08-05 22:08:05.75 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
211 2013-08-05 22:08:05.84 登录 错误: 18456,严重性: 14,状态: 7
212 2013-08-05 22:08:05.84 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
213 2013-08-05 22:08:05.93 登录 错误: 18456,严重性: 14,状态: 7
214 2013-08-05 22:08:05.93 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
215 2013-08-05 22:08:06.03 登录 错误: 18456,严重性: 14,状态: 7
216 2013-08-05 22:08:06.03 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
217 2013-08-05 22:08:06.12 登录 错误: 18456,严重性: 14,状态: 7
218 2013-08-05 22:08:06.12 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
219 2013-08-05 22:08:06.21 登录 错误: 18456,严重性: 14,状态: 7
220 2013-08-05 22:08:06.21 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
221 2013-08-05 22:08:06.31 登录 错误: 18456,严重性: 14,状态: 7
222 2013-08-05 22:08:06.31 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
223 2013-08-05 22:08:06.40 登录 错误: 18456,严重性: 14,状态: 7
224 2013-08-05 22:08:06.40 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
225 2013-08-05 22:08:06.49 登录 错误: 18456,严重性: 14,状态: 7
226 2013-08-05 22:08:06.49 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
227 2013-08-05 22:08:06.58 登录 错误: 18456,严重性: 14,状态: 7
228 2013-08-05 22:08:06.58 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
229 2013-08-05 22:08:06.67 登录 错误: 18456,严重性: 14,状态: 7
230 2013-08-05 22:08:06.67 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
231 2013-08-05 22:08:06.77 登录 错误: 18456,严重性: 14,状态: 7
232 2013-08-05 22:08:06.77 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
233 2013-08-05 22:08:06.86 登录 错误: 18456,严重性: 14,状态: 7
234 2013-08-05 22:08:06.86 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
235 2013-08-05 22:08:06.95 登录 错误: 18456,严重性: 14,状态: 7
236 2013-08-05 22:08:06.95 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]
237 2013-08-05 22:08:07.04 登录 错误: 18456,严重性: 14,状态: 7
238 2013-08-05 22:08:07.04 登录 Login failed for user 'sa'. [客户端: 59.188.137.45]

可以看到两者的区别

不正常的比正常的多出了下面这几个语句

 1 25 transactions rolled forward in database 'msdb' (4). This is an informational message only. No user action is required.
2 2013-08-05 19:18:14.78 spid5s 0 transactions rolled back in database 'msdb' (4). This is an informational message only. No user action is required.
3 2013-08-05 19:18:14.78 spid5s Recovery is writing a checkpoint in database 'msdb' (4). This is an informational message only. No user action is required.
4 2013-08-05 19:18:19.86 spid15s Analysis of database 'GPOSDB' (5) is 5% complete (approximately 4 seconds remain). This is an informational message only. No user action is required.
5 2013-08-05 19:18:23.85 spid15s Analysis of database 'GPOSDB' (5) is 82% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
6 2013-08-05 19:18:24.88 spid15s Analysis of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
7 2013-08-05 19:18:24.88 spid15s Recovery of database 'GPOSDB' (5) is 0% complete (approximately 261 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
8 2013-08-05 19:18:25.02 spid15s Recovery of database 'GPOSDB' (5) is 1% complete (approximately 7 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
9 2013-08-05 19:18:30.50 spid15s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
10 2013-08-05 19:18:30.50 spid15s 214 transactions rolled forward in database 'GPOSDB' (5). This is an informational message only. No user action is required.
11 2013-08-05 19:18:30.61 spid15s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
12 2013-08-05 19:18:30.71 spid5s Recovery of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
13 2013-08-05 19:18:30.71 spid5s 0 transactions rolled back in database 'GPOSDB' (5). This is an informational message only. No user action is required.
14 2013-08-05 19:18:30.71 spid5s Recovery is writing a checkpoint in database 'GPOSDB' (5). This is an informational message only. No user action is required.
15 2013-08-05 19:18:30.73 spid5s Recovery is complete. This is an informational message only. No user action is required.

SQLSERVER不断分析和恢复我们的业务数据库GPOSDB

我还截取了一些关键日志

 1 2013-08-05 19:19:26.42 spid12s     Analysis of database 'GPOSDB' (5) is 5% complete (approximately 7 seconds remain). This is an informational message only. No user action is required.
2 2013-08-05 19:19:28.58 spid12s Analysis of database 'GPOSDB' (5) is 49% complete (approximately 2 seconds remain). This is an informational message only. No user action is required.
3 2013-08-05 19:19:31.44 spid12s Analysis of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
4 2013-08-05 19:19:31.44 spid12s Recovery of database 'GPOSDB' (5) is 0% complete (approximately 261 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
5 2013-08-05 19:19:31.58 spid12s Recovery of database 'GPOSDB' (5) is 1% complete (approximately 7 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
6 2013-08-05 19:19:35.60 spid12s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
7 2013-08-05 19:19:35.60 spid12s 214 transactions rolled forward in database 'GPOSDB' (5). This is an informational message only. No user action is required.
8 2013-08-05 19:19:35.87 spid12s Recovery of database 'GPOSDB' (5) is 57% complete (approximately 3 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
9 2013-08-05 19:19:35.94 spid5s Recovery of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
10 2013-08-05 19:19:35.94 spid5s 0 transactions rolled back in database 'GPOSDB' (5). This is an informational message only. No user action is required.
11 2013-08-05 19:19:35.94 spid5s Recovery is writing a checkpoint in database 'GPOSDB' (5). This is an informational message only. No user action is required.
12 2013-08-05 19:19:36.00 spid5s Recovery is complete. This is an informational message only. No user action is required.
13 2013-08-05 19:20:07.03 spid51 Autogrow of file 'GPOSDB_log' in database 'GPOSDB' was cancelled by user or timed out after 31000 milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.
14 2013-08-05 19:20:22.60 服务器 SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
15
16 ---------------------------------------------------------------------------------
17 2013-08-05 19:24:20.08 登录 错误: 18456,严重性: 14,状态: 16
18 2013-08-05 19:24:20.08 登录 Login failed for user 'dreamlink'. [客户端: 127.0.0.1]
19 2013-08-05 19:24:21.64 spid12s Analysis of database 'GPOSDB' (5) is 94% complete (approximately 5 seconds remain). This is an informational message only. No user action is required.
20 2013-08-05 19:24:22.03 登录 错误: 18456,严重性: 14,状态: 16
21 2013-08-05 19:24:22.03 登录 Login failed for user 'dreamlink'. [客户端: 127.0.0.1]
22 2013-08-05 19:24:30.62 spid12s Analysis of database 'GPOSDB' (5) is 99% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
23 2013-08-05 19:24:31.55 spid12s Analysis of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). This is an informational message only. No user action is required.
24 2013-08-05 19:24:31.56 spid12s Recovery of database 'GPOSDB' (5) is 0% complete (approximately 261 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
25 2013-08-05 19:24:32.57 spid12s Recovery of database 'GPOSDB' (5) is 1% complete (approximately 83 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
26 2013-08-05 19:24:38.31 spid12s Recovery of database 'GPOSDB' (5) is 7% complete (approximately 87 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
27 2013-08-05 19:24:41.96 登录 错误: 18456,严重性: 14,状态: 16
28 2013-08-05 19:24:41.96 登录 Login failed for user 'dreamlink'. [客户端: 127.0.0.1]
29 2013-08-05 19:24:41.96 登录 错误: 18456,严重性: 14,状态: 16
30 2013-08-05 19:24:41.96 登录 Login failed for user 'dreamlink'. [客户端: 127.0.0.1]
31 2013-08-05 19:24:45.10 spid12s Recovery of database 'GPOSDB' (5) is 12% complete (approximately 94 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
32 2013-08-05 19:24:47.46 spid12s Recovery of database 'GPOSDB' (5) is 17% complete (approximately 77 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
33 2013-08-05 19:24:47.87 spid12s Recovery of database 'GPOSDB' (5) is 22% complete (approximately 56 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
34 2013-08-05 19:24:48.10 spid12s Recovery of database 'GPOSDB' (5) is 28% complete (approximately 40 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
35 2013-08-05 19:24:48.40 spid12s Recovery of database 'GPOSDB' (5) is 36% complete (approximately 28 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
36 2013-08-05 19:24:49.06 spid12s Recovery of database 'GPOSDB' (5) is 46% complete (approximately 19 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
37 2013-08-05 19:24:49.68 spid12s Recovery of database 'GPOSDB' (5) is 58% complete (approximately 12 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
38 2013-08-05 19:24:50.42 spid12s Recovery of database 'GPOSDB' (5) is 73% complete (approximately 6 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
39 2013-08-05 19:24:54.18 spid12s Recovery of database 'GPOSDB' (5) is 86% complete (approximately 3 seconds remain). Phase 2 of 3. This is an informational message only. No user action is required.
40 2013-08-05 19:24:54.18 spid12s 214 transactions rolled forward in database 'GPOSDB' (5). This is an informational message only. No user action is required.
41 2013-08-05 19:24:54.42 spid12s Recovery of database 'GPOSDB' (5) is 86% complete (approximately 3 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
42 2013-08-05 19:24:54.48 spid4s Recovery of database 'GPOSDB' (5) is 100% complete (approximately 0 seconds remain). Phase 3 of 3. This is an informational message only. No user action is required.
43
44 -----------------------------------------------------------------------------
45 013-08-05 19:20:47.85 登录 Login failed for user 'bwsa'. [客户端: 61.147.103.137]
46 2013-08-05 19:20:47.90 登录 错误: 18456,严重性: 14,状态: 5
47 2013-08-05 19:20:47.90 登录 Login failed for user 'bwsa'. [客户端: 61.147.103.137]
48 2013-08-05 19:20:47.95 登录 错误: 18456,严重性: 14,状态: 5
49 2013-08-05 19:20:47.95 登录 Login failed for user 'bwsa'. [客户端: 61.147.103.137]
50 2013-08-05 19:20:47.78 spid51 错误: 17054,严重性: 16,状态: 1
51 2013-08-05 19:20:47.78 spid51 The current event was not reported to the Windows Events log. Operating system error = 1717(接口未知。). You may need to clear the Windows Events log if it is full.
52 2013-08-05 19:20:47.95 登录 错误: 18456,严重性: 14,状态: 7

关键的日志:

2013-08-05 19:20:22.60 服务器         SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.

2013-08-05 19:20:47.78 spid51      The current event was not reported to the Windows Events log. Operating system error = 1717(接口未知。). You may need to clear the Windows Events log if it is full.

 

 

 还有下面这个非常重要的日志

1 013-08-05 21:27:51.24 登录          错误: 18456,严重性: 14,状态: 5
2 2013-08-05 21:27:51.24 登录 Login failed for user 'xxx'. [客户端: 210.56.63.37]
3 2013-08-05 21:33:05.25 spid53 Autogrow of file 'GPOSDB_log' in database 'GPOSDB' was cancelled by user or timed out after 30391 milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.
4 2013-08-05 21:41:53.20 登录 错误: 18456,严重性: 14,状态: 7
5 2013-08-05 21:41:53.20 登录 Login failed for user 'sa'. [客户端: 124.31.204.74]
6 2013-08-05 21:41:53.34 登录 错误: 18456,严重性: 14,状态: 7

 

 

 2013-08-05 21:33:05.25 spid53      Autogrow of file 'GPOSDB_log' in database 'GPOSDB' was cancelled by user or timed out after 30391 milliseconds.  Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.

2013-08-05 19:20:07.03 spid51      Autogrow of file 'GPOSDB_log' in database 'GPOSDB' was cancelled by user or timed out after 31000 milliseconds.  Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size.

--------------------------------华丽的分割线--------------------------------------------

方向

 我认为连接超时就是跟GPOSDB_log的自动增长有关,先解决这个增长问题

看一下LDF文件的大小

 

由于GPOSDB这个数据库本来是运行在SQLSERVER2000上的,后来要升级到SQLSERVER2005

就用附加分离方法附加到SQL2005上,但是考虑到以后有可能将GPOSDB又运行在SQL2000上

所以没有把GPOSDB的数据库兼容级别设置为90(SQL2005),而且这个数据库已经用了3年多

所以22.5GB的事务日志文件大小不奇怪,但是数据量不多,mdf文件大小才大概26MB

因为这个数据库一直使用默认的设置,即默认的文件增长设置(按数据文件和事务日志文件大小的10%来增长)

而在《SQLSERVER企业级平台管理实践》里提到

设置数据库自动增长注意要点 

要设置成按固定大小增长,而不能按比例  对于小的数据库,设置一次增长50MB到100MB,大的数据库,一次增长100MB到200MB

因为这个数据库才大概26MB的大小(mdf文件26MB),属于小型数据库,我就设置事务日志文件一次增长50MB

而数据文件大小的增长设置可以不用动

然后我就使用下面的SQL语句,截断事务日志,收缩事务日志文件,由于我不知道事务日志文件压缩多少

我就设置了收缩到10MB

 1 --脚本
2 USE GPOSDB
3 GO
4 --截断日志
5 BACKUP LOG GPOSDB TO DISK='d:\gposdblogbackup2013-8-5.trn' with TRUNCATE_ONLY
6 GO
7
8 --查看一下数据库信息
9 EXEC sp_helpdb @dbname='gposdb'
10 GO
11
12 --收缩事务日志文件到10MB
13 DBCC SHRINKFILE(GPOSDB_log,10)
14 GO
15
16 --再查看一下数据库信息
17 EXEC sp_helpdb @dbname='gposdb'
18 GO

执行完SQL语句之后,再看一下事务日志文件的大小和数据库情况

----------------------------华丽的分割线-----------------------------------

关于另外的那两个错误

我的笔记本电脑里的SQLSERVER 也出现了下面两个SQL日志信息,所以本人觉得下面两个错误问题不大
2013-08-05 00:37:12.04 spid11s The current event was not reported to the Windows Events log. Operating system error = 31(连到系统上的设备没有发挥作用。). You may need to clear the Windows Events log if it is full.

2013-08-05 19:20:47.78 spid51 The current event was not reported to the Windows Events log. Operating system error = 1717(接口未知。). You may need to clear the Windows Events log if it is full.

 

而下面这个SQL日志信息我估计是当时掉电造成SQLSERVER terminating

2013-08-05 19:20:22.60 服务器 SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.

-------------------------------华丽的分割线------------------------------

这个解决办法有没有效明天就知道了

 

因为客户的办公室那里电压不稳定,刚好UPS又坏了,经常停电,一停电电脑又关机了

我担心这样每天这样毫无防御地关机会影响到硬盘,电脑经常突然掉电硬盘又可能损坏了而造成上面的情况

明天用HDTUNE检查一下硬盘看一下有没有坏道

由于随笔是在酒店写的,所以格式就将就一下吧O(∩_∩)O

-------------------------------------华丽的分割线-------------------------

 因为下面两个错误没有错误号,由于本人资历尚浅,希望知道下面两个错误的错误原因的可以告诉我一声

2013-08-05 00:37:12.04 spid11s The current event was not reported to the Windows Events log. Operating system error = 31(连到系统上的设备没有发挥作用。). You may need to clear the Windows Events log if it is full.

2013-08-05 19:20:47.78 spid51 The current event was not reported to the Windows Events log. Operating system error = 1717(接口未知。). You may need to clear the Windows Events log if it is full.

 

如有不对的地方,敬请拍砖O(∩_∩)O

---------------------------------------------------------

2013-8-6补充

今天早上我到客户那里做了2个事情

1:把数据文件自动增长设置为一次自动增长50MB(虽然只有25MB大小而且数据量不像事物日志文件那样猛增,

为保险起见还是设置一下比较好)

2:使用HDTUNE检查硬盘,完整扫描了一次硬盘之后发现没有坏道

看了一下事物日志文件,大小为75MB,而且观察了到现在为止还没有发生连接超时的情况

原因:我怀疑是SQLSERVER需要格式化的硬盘空间太大,因为每次增长10%,那么事物日志文件每次需要增长22.5GB*10%=2.25GB

而且客户的电脑配置比较低,估计因为SQLSERVER格式化的时候出现问题,30秒都没有格式化好这部分空间

Autogrow of file 'GPOSDB_log' in database 'GPOSDB' was cancelled by user or timed out after 31000 milliseconds

 

---------------------------------------------------------

2013-8-7补充

今天再看2013-8-6和2013-8-7这两天的Windows日志和SQL ERROR LOG,没有发现弹出“连接超时”对话框和'GPOSDB_log'事务日志文件

增长失败的日志信息

还有事务日志文件现在有250MB大小

证明事务日志文件增长了,而且增长还算顺利,从中也证明了我这个方法是有效的o(∩_∩)o

 


2013-11-21补充:

2013-08-05 22:05:43.46 登录          错误: 18456,严重性: 14,状态: 7。

http://blogs.msdn.com/b/apgcdsd/archive/2011/09/27/kerberos-ntlm-sql-server.aspx

当你看到Login failed for user <username>时,这其实是一个授权(authorization)错误。

此时,SQL Server已经识别出了要求登录用户,但是由于SQL Server内部的安全相关的设置,登录操作没有成功。

我们常见的18456错误就属于这类错误:  Error: 18456, Severity: 14, State: XX.
 
我们可以通过State:XX来判断到底是什么原因导致的授权失败。

但是,由于担心恶意的客户端可能通过state来猜测失败原因并采取相应手段来攻击服务器,State是不能返回客户端的

它会被写入SQL的ERROELOG文件。

失败state对应的原因:

1 通用错误
2 远程登录的登录在服务器中不存在
3,4 解密内存中加密的密码失败
5 SQL登录不存在
6 连接的SQL登录不符合登录类型列表
7 登录功能关闭
8 密码不符合
9密码不可用(登录时正在修改密码)
10 账户策略验证失败
如果以下密码策略检查评估返回假:
(1)登录成功
(2)密码已过期
(3)用户需要更改密码
然后我们设置登录状态,并返回一个失败state10
11 windows验证没有被授权可以连接
12 SQL验证没有被授权可以连接
13 服务器暂停,禁止所有登陆
14 登录不能用于此连接的接口类型
15 连接字符串中指定的数据库无效
16个默认数据库是无效的
17默认语言为无效
18这种登录类型密码不能改变
19无法解密加密的内存中的新密码

推荐 0
本文由 桦仔 创作,采用 知识共享署名-相同方式共享 3.0 中国大陆许可协议 进行许可。
转载、引用前需联系作者,并署名作者且注明文章出处。
本站文章版权归原作者及原出处所有 。内容为作者个人观点, 并不代表本站赞同其观点和对其真实性负责。本站是一个个人学习交流的平台,并不用于任何商业目的,如果有任何问题,请及时联系我们,我们将根据著作权人的要求,立即更正或者删除有关内容。本站拥有对此声明的最终解释权。

0 个评论

要回复文章请先登录注册