我的 SQL Server 2008 运行良好。大约一小时前,它突然停止了 - MSSQLSERVER 服务已停止,我右键单击,单击“启动”,它显示服务已启动,然后停止
我查看了事件日志并发现以下两个错误:
17207 :
udopen: Operating system error 3(error not found) during the creation/opening of physical device C:\Program Files\Microsoft SQL Server\MSSQL\data\model.mdf.
17204 :
FCB::Open failed: Could not open device C:\Program Files\Microsoft SQL Server\MSSQL\data\model.mdf for virtual device number (VDN) 1.
model.mdf db 从来没有出现在该位置 - 我在安装期间指定驱动器 F: 用于数据/日志。
我检查了 SQL 配置管理器,尝试设置启动参数,但 SQL Server 并未列为服务之一.....
编辑:
我现在已将数据库移动到它正在寻找的位置:
C:\Program Files\Microsoft SQL Server\MSSQL\data\
目录。
现在,如果我启动该服务,它仍然不起作用 - 我在日志中收到此错误消息:
Could not find row in sysindexes for database ID 3, object ID 1, index ID 1. Run DBCC CHECKTABLE on sysindexes.
有趣的是,我检查了错误日志 - 在用户报告问题时,有这样的内容:
2010-01-08 17:11:26.44 spid51 Configuration option 'show advanced options' changed from 0 to 1. Run the RECONFIGURE statement to install.
2010-01-08 17:11:26.44 spid51 FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2010-01-08 17:11:26.44 spid51 Configuration option 'Agent XPs' changed from 1 to 0. Run the RECONFIGURE statement to install.
2010-01-08 17:11:26.44 spid51 FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2010-01-08 17:11:26.44 spid51 Configuration option 'show advanced options' changed from 1 to 0. Run the RECONFIGURE statement to install.
2010-01-08 17:11:26.44 spid51 FILESTREAM: effective level = 0, configured level = 0, file system access share name = 'MSSQLSERVER'.
2010-01-08 17:11:44.89 spid10s Service Broker manager has shut down.
2010-01-08 17:11:47.83 spid7s SQL Server is terminating in response to a 'stop' request from Service Control Manager. This is an informational message only. No user action is required.
2010-01-08 17:11:47.83 spid7s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
答案1
首先,似乎有人正在使用 sp_configure 更改您数据库上的选项,您知道这是谁吗?看起来这发生在脚本中(时间很接近)他们可能还使用类似于以下过程更改了模型数据库的位置这 更改后,sql server 服务已关闭,这就是您看到默认跟踪和服务代理停止(正常)的原因。如果它被更改为不正确的位置,那么这将解释为什么 sql server 无法启动
数据库 ID 为 3 的是模型数据库,因此您移动的模型副本可能不正确,或者模型已损坏。您有 2 个选项,具体取决于您的设置,哪个选项对您来说更简单。
答案2
这可能是愚蠢的问题,但是您是否在卷上运行了 chkdsk ?
您是否已确认 F: 驱动器和文件位于您上次放置的位置?并且 chkdsk 没有发现这些问题?
您是否已验证相关目录(和驱动器)的权限?
答案3
愚蠢的问题:您是否尝试过重新启动服务器?