使用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配置的特定问题吗?或导致此问题的代码问题?
答案 0 :(得分:2)
您有一个名为SDomain的数据库设置为自动关闭。无论何时访问,它都是“已启动”。最近,您或您附近的人删除或移动了数据库的LDF文件。当访问SDomdain数据库的进程尝试打开它时,SQL Server将在ERRORLOG中抱怨问题。给数据库支持其LDF并停止抱怨。执行sp_cycle_errorlog
以启动新的ERRORLOG文件,以便删除旧文件。
答案 1 :(得分:0)
答案 2 :(得分:-1)
数据库开始自行恢复的常见原因是:
答案 3 :(得分:-1)
确保用户帐户servername \ SQLServer2005MSSQLUser $ servername $ SQLEXPRESS具有对数据库所在目录的写访问权。