断电后 MS SQL 服务无法启动 (3 次更新)

断电后 MS SQL 服务无法启动 (3 次更新)

几天前,我住的地方发生了短暂的停电,当我重新启动装有 MS SQL 2008 R2 的 Windows 7 计算机时,一切似乎都运行正常,只是 MS SQL 服务无法启动。我很确定断电时没有人在使用数据库。

当使用 SQL Server 配置管理器尝试再次启动服务时,它显示:

The request failed, or the service did not respond in a timely fashion.
Consult the log or other applicable error logs for details.

运行 sqlsrvr.exe 时,它​​说正在重新整理我的数据库,然后它说已经完成恢复,但它只是呆在那里几个小时什么也不做,而且服务从未启动。

请帮忙!

更新: 因此,当通过配置监视器启动它时,错误日志中不会有任何内容,但是当运行 sqlservr.exe 时,它​​输出的内容如下,然后就什么也不做:

2010-11-07 16:06:32.83 Server      Microsoft SQL Server 2008 R2 (RTM) - 10.50.1600.1 (X64) 
Apr  2 2010 15:48:46 
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7600: )

2010-11-07 16:06:32.83 Server      (c) Microsoft Corporation.
2010-11-07 16:06:32.83 Server      All rights reserved.
2010-11-07 16:06:32.83 Server      Server process ID is 2468.
2010-11-07 16:06:32.83 Server      System Manufacturer: 'Gigabyte Technology Co., Ltd.', System Model: 'EP43-UD3L'.
2010-11-07 16:06:32.83 Server      Authentication mode is MIXED.
2010-11-07 16:06:32.83 Server      Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2010-11-07 16:06:32.83 Server      This instance of SQL Server last reported using a process ID of 3716 at 11/6/2010 4:19:02 PM (local) 11/6/2010 11:19:02 PM (UTC). This is an informational message only; no user action is required.
2010-11-07 16:06:32.83 Server      Registry startup parameters: 
    -d C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
    -e C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
    -l C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2010-11-07 16:06:32.84 Server      SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2010-11-07 16:06:32.84 Server      Detected 4 CPUs. This is an informational message; no user action is required.
2010-11-07 16:06:32.94 Server      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.
2010-11-07 16:06:32.95 Server      Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2010-11-07 16:06:32.98 spid7s      Starting up database 'master'.
2010-11-07 16:06:33.07 spid7s      1 transactions rolled forward in database 'master' (1). This is an informational message only. No user action is required.
2010-11-07 16:06:33.08 spid7s      0 transactions rolled back in database 'master' (1). This is an informational message only. No user action is required.
2010-11-07 16:06:33.08 spid7s      Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2010-11-07 16:06:33.17 spid7s      Resource governor reconfiguration succeeded.
2010-11-07 16:06:33.17 spid7s      SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2010-11-07 16:06:33.17 spid7s      SQL Server Audit has started the audits. This is an informational message. No user action is required.
2010-11-07 16:06:33.18 spid7s      FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2010-11-07 16:06:33.21 spid7s      SQL Trace ID 1 was started by login "sa".
2010-11-07 16:06:33.21 spid7s      Starting up database 'mssqlsystemresource'.
2010-11-07 16:06:33.22 spid7s      The resource database build version is 10.50.1600. This is an informational message only. No user action is required.
2010-11-07 16:06:33.35 spid11s     Starting up database 'model'.
2010-11-07 16:06:33.35 spid7s      Server name is 'XXXXXXX'. This is an informational message only. No user action is required.
2010-11-07 16:06:33.42 spid11s     Clearing tempdb database.
2010-11-07 16:06:33.48 spid13s     A new instance of the full-text filter daemon host process has been successfully started.
2010-11-07 16:06:33.49 spid14s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.49 spid15s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.49 spid13s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.49 spid16s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.49 spid17s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.49 spid19s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.50 spid18s     Starting up database 'XXXXXXX'.
2010-11-07 16:06:33.51 Server      A self-generated certificate was successfully loaded for encryption.
2010-11-07 16:06:33.51 Server      Server is listening on [ 'any' <ipv6> 1433].
2010-11-07 16:06:33.51 Server      Server is listening on [ 'any' <ipv4> 1433].
2010-11-07 16:06:33.52 Server      Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2010-11-07 16:06:33.52 Server      Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
2010-11-07 16:06:33.52 Server      Server is listening on [ ::1 <ipv6> 1434].
2010-11-07 16:06:33.52 Server      Server is listening on [ 127.0.0.1 <ipv4> 1434].
2010-11-07 16:06:33.52 Server      Dedicated admin connection support was established for listening locally on port 1434.
2010-11-07 16:06:33.52 Server      The SQL Server 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.
2010-11-07 16:06:33.58 Server      SQL Server is now ready for client connections. This is an informational message; no user action is required.
2010-11-07 16:06:34.28 spid15s     1 transactions rolled forward in database 'ReportServerTempDB' (6). This is an informational message only. No user action is required.
2010-11-07 16:06:34.56 spid7s      0 transactions rolled back in database 'ReportServerTempDB' (6). This is an informational message only. No user action is required.
2010-11-07 16:06:34.56 spid7s      Recovery is writing a checkpoint in database 'ReportServerTempDB' (6). This is an informational message only. No user action is required.
2010-11-07 16:06:35.26 spid11s     Starting up database 'tempdb'.
2010-11-07 16:06:35.59 spid13s     The Service Broker protocol transport is disabled or not configured.
2010-11-07 16:06:35.59 spid13s     The Database Mirroring protocol transport is disabled or not configured.
2010-11-07 16:06:35.64 spid13s     Service Broker manager has started.
2010-11-07 16:06:38.52 spid7s      Recovery is complete. This is an informational message only. No user action is required.

这是我在计算机启动时收到的唯一警告。它的来源是用户配置文件服务(根据事件查看器):

    Windows detected your registry file is still in use by other applications or services. The file will be unloaded now. The applications or services that hold your registry file may not function properly afterwards.  

 DETAIL - 
 6 user registry handles leaked from \Registry\User\S-1-5-21-1327984882-2424197892-1977549990-1000:
Process 616 (\Device\HarddiskVolume2\Windows\System32\lsass.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000
Process 616 (\Device\HarddiskVolume2\Windows\System32\lsass.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000
Process 980 (\Device\HarddiskVolume2\Windows\System32\svchost.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000\Printers\DevModePerUser
Process 616 (\Device\HarddiskVolume2\Windows\System32\lsass.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000\Software\Microsoft\SystemCertificates\Disallowed
Process 616 (\Device\HarddiskVolume2\Windows\System32\lsass.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000\Software\Microsoft\SystemCertificates\My
Process 616 (\Device\HarddiskVolume2\Windows\System32\lsass.exe) has opened key \REGISTRY\USER\S-1-5-21-1327984882-2424197892-1977549990-1000\Software\Microsoft\SystemCertificates\CA

此后,下一个事件日志显示用户配置文件服务已停止(信息日志)。

更新 2: 我尝试恢复到断电前的恢复点,但没有任何帮助。此外,运行 sqlservr.exe 时,我发现 sql server 实际上正在运行,我只是懒得检查。因此,只要该命令窗口保持打开状态,sql server 就可以访问,但我想让服务再次运行。你们建议我备份数据库并重新安装 SQL server 吗?

更新 3: 以下是尝试启动服务时的系统事件错误:

Error1:
The MSSQLSERVER service was unable to log on as .\Username with the currently configured password due to the following error: 
Logon failure: unknown user name or bad password.
To ensure that the service is configured properly, use the Services snap-in in Microsoft Management Console (MMC).

Error 2:
The SQL Server (MSSQLSERVER) service failed to start due to the following error: 
The service did not start due to a logon failure.

答案1

您是否遇到了磁盘问题?您是否将日志或索引写入了可能已满的另一个卷?或者数据库卷上可能没有足够的可用空间来进行恢复?

相关内容