如何截断和收缩日志文件?
如何在 SQL Server 2005 中截断和收缩大型日志文件? 如何定期应用截断?
截断和收缩有什么区别吗?
提前致谢
How to truncate and shrink large log files in SQL Server 2005? How to apply truncation at regular intervals?
Is there any difference between truncation and shrinking?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
使用 DBCC SHRINKFILE 并将其安排为定期运行的作业(最好在非工作时间)。
请注意,定期增长和收缩日志文件会对性能造成影响。 如果有空间,您可能需要将文件大小设置为正常增长的最大值,然后保留它。
Use DBCC SHRINKFILE and schedule it as a job that runs regularly (preferably during off-hours).
Just be aware that there is a performance hit from regularly growing and shrinking the log file. If you have the space, you may want to set the file size to the maximum that it normally grows to and just leave it.
可靠的收缩是通过
Reliable shrinking is achieved by
使用 DBCC SHRINKFILE 语句。
Use the
DBCC SHRINKFILE
statement.首先你应该改变你的数据库恢复模式
属性-> 选项-> 恢复模型
并将其更改为简单,然后缩小日志文件
右键单击-> 任务-> 收缩-> 文件
并选择文件类型“日志”并单击“确定”
first you should change your database recovery mode on
Properties - > Option -> Recovery Model
and change it to simple and then shrink log file from
Right Click -> Tasks -> Shrink -> Files
and choose file type 'Log' and click ok