SQL Server 2005 Express的大错误日志(15GB)

时间:2009-08-11 08:10:04

标签: sql-server sql-server-2005

使用SQL Server 2005 Express(在XP和Server 2003上观察到),我有时会在生产中获得巨大的错误日志文件: 文件C:\ Program Files \ Microsoft SQL Server \ MSSQL.1 \ MSSQL \ LOG \ ERRORLOG增长以填充磁盘(文件大小超过15 GB)。

此文件不是事务日志,只是错误日志:SQL Server的文本日志。

错误日志的开头如下:(似乎正常)

2009-01-11 09:16:57.04 spid51      Starting up database 'SDomain'. 
2009-01-11 10:04:34.21 spid21s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due  
to some database maintenance or reconfigure operations. 
2009-01-11 10:04:34.23 spid21s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to  
some database maintenance or reconfigure operations. 
2009-01-11 10:04:34.23 spid21s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due t 
o some database maintenance or reconfigure operations. 
2009-01-11 10:08:37.32 spid51      Starting up database 'SDomain'. 
2009-01-11 10:56:55.48 spid22s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due  
to some database maintenance or reconfigure operations. 
2009-01-11 10:56:55.49 spid22s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to  
some database maintenance or reconfigure operations. 
2009-01-11 10:56:55.49 spid22s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due t 
o some database maintenance or reconfigure operations. 
2009-01-11 11:00:07.51 spid51      Starting up database 'SDomain'. 
2009-01-11 11:47:44.73 spid15s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Object Plans' cachestore (part of plan cache) due  
to some database maintenance or reconfigure operations. 
2009-01-11 11:47:44.74 spid15s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'SQL Plans' cachestore (part of plan cache) due to  
some database maintenance or reconfigure operations. 
2009-01-11 11:47:44.74 spid15s     SQL Server has encountered 1 occurrence(s) of cachestore flush for the 'Bound Trees' cachestore (part of plan cache) due t 
o some database maintenance or reconfigure operations. 

然后该文件似乎包含无休止的重复行:

2008-12-17 00:12:24.03 spid13s     The log for database 'SDomain' is not available. Check the event log for related error messages. Resolve any errors and restart the database**

仅供参考,windows eventlog包含完全相同的消息。

知道出现此问题的原因吗?它可能是SQL Server配置的特定问题吗?或导致此问题的代码问题?

4 个答案:

答案 0 :(得分:2)

您有一个名为SDomain的数据库设置为自动关闭。无论何时访问,它都是“已启动”。最近,您或您附近的人删除或移动了数据库的LDF文件。当访问SDomdain数据库的进程尝试打开它时,SQL Server将在ERRORLOG中抱怨问题。给数据库支持其LDF并停止抱怨。执行sp_cycle_errorlog以启动新的ERRORLOG文件,以便删除旧文件。

答案 1 :(得分:0)

答案 2 :(得分:-1)

数据库开始自行恢复的常见原因是:

  • SQL Service已从服务控制管理器关闭或服务器关闭
  • 数据库上发生致命错误,迫使SQL Server关闭数据库并将其恢复
  • 有人使用RESTORE WITH RECOVERY命令手动启动数据库恢复
  • 数据库备份已还原到数据库中 在此阶段,您的数据库不会响应任何用户请求。只有在恢复阶段完成后,用户才能访问数据库。 要找出发生这种情况的原因,您可能需要检查SQL Server ERRORLOG并找出在数据库恢复开始之前找到的内容。 SQL Server ERRORLOG中将记录任何致命错误或数据库还原操作。 还要检查是否为数据库启用了“自动关闭”选项。如果那是真的你需要关闭该选项,如下所示,
    1. 右键单击数据库。
    2. 选择属性
    3. 点击选项。
    4. AutoClose是第一个选项,并确保将其标记为False。

答案 3 :(得分:-1)

确保用户帐户servername \ SQLServer2005MSSQLUser $ servername $ SQLEXPRESS具有对数据库所在目录的写访问权。