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

发布于 2024-08-01 16:38:38 字数 2747 浏览 2 评论 0原文

使用 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事件日志包含完全相同的消息。

知道这个问题发生的原因吗? 难道是SQL Server配置的特殊问题? 或者是代码中的问题导致了这种情况?

With SQL Server 2005 Express (obeserved on XP and Server 2003), I get sometimes huge Error logs files in production:
The file C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG grows to fill the disk (file size becomes more than 15 GB).

This file is not the transaction log, just the error log : a text log for SQL Server.

The error log starts like this: (seems to be normal)

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. 

Then the file seems to contain endlessly repeating lines like this:

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**

FYI, the windows eventlog contains exactly the same messages.

Any idea of the reason why this problem occurs? Could it be a particular issue of configuration of SQL Server? Or an issue in code causing this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

何以笙箫默 2024-08-08 16:38:38

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

You have a database named SDomain that is set to auto-close. Whenever is accessed, it is 'started'. Recently you, or someone near you, deleted or moved the LDF file of the database. When the process that is accessing the SDomdain database is trying to open it, SQL Server will complain about the problem in the ERRORLOG. Give the database back its LDF and will stop complaining. Execute sp_cycle_errorlog to start a new ERRORLOG file so you can delete the old one.

三生一梦 2024-08-08 16:38:38

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

Ensure user account servername\SQLServer2005MSSQLUser$servername$SQLEXPRESS has write access to the directory that your database is residing in.

ぃ双果 2024-08-08 16:38:38

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

  • SQL 服务从服务控制管理器关闭或由于服务器关闭
  • 数据库发生致命错误,迫使 SQL Server 关闭数据库并恢复
  • 有人手动使用 RESTORE WITH RECOVERY 命令启动数据库恢复
  • 数据库备份已恢复到数据库
    在此阶段您的数据库将不会响应任何用户请求。 只有恢复阶段完成后,用户才可以访问数据库。
    要找出发生这种情况的原因,您可能需要检查 SQL Server 错误日志并找出在数据库开始恢复之前发现的内容。 任何致命错误或数据库恢复操作都将记录在 SQL Server ERRORLOG 中。
    另请检查您的数据库是否启用了“自动关闭”选项。 如果这是真的,您需要关闭该选项,如下所示,

    1. 右键单击数据库。
    2. 选择属性
    3. 单击“选项”。
    4. AutoClose 是第一个选项,并确保将其标记为 False。

The common reasons why a database would start recovering on its own are:

  • The SQL Service was shutdown from the Service Control Manager or due a server shutdown
  • A fatal error occurred on the database which forced SQL Server to shut down the database and recover it
  • Someone manually initiated a recovery on the database using RESTORE WITH RECOVERY command
  • A database backup was restored onto the database
    During this phase your database will not respond to any user requests. Only once the recovery phase is complete will the database be accessible to users.
    To find out why this happened you might want to check the SQL Server ERRORLOG and find out what find right before the recovery started on the database. Any fatal errors or database restore operations would be logged in the SQL Server ERRORLOG.
    Also check if Auto Close option is enabled for your database. If thats true you need to turn off that option as follows,

    1. Right click the database.
    2. Select Properties
    3. Click on Options.
    4. AutoClose is the first option and ensure that it is marked as False.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文