简体   繁体   English

如何减少SQL日志文件的大小

[英]How to reduce SQL log file size

SQL log file size is very big in our production database and hard disk space left only 2G. 我们的生产数据库中SQL日志文件的大小非常大,硬盘空间仅剩2G。 Is it safe to delete .ldf file? 删除.ldf文件安全吗?

Check out this post 看看这个帖子

In the interim, this should at least allow you to kill the log file: 在此期间,这至少应允许您杀死日志文件:

  1. Perform a full backup of your database. 对数据库执行完整备份。 Don't skip this. 不要跳过这个。 Really. 真。
  2. Change the backup method of your database to "Simple" 将数据库的备份方法更改为“简单”
  3. Open a query window and enter "checkpoint" and execute 打开查询窗口并输入“检查点”并执行
  4. Perform another backup of the database Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple) 执行数据库的另一次备份将数据库的备份方法更改为“完整”(或者,如果不是简单的话,则改为原来的备份)
  5. Perform a final full backup of the database. 对数据库执行最终的完整备份。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM