Skip to content

怎么删除SQL Server日志

做法一

原本在GOOGLE上找到一段非常长的清除办法,实际也就是通过DBCC SHRINKDATABASE来收缩数据文件、日志,但是收缩数据时并不会保存索引中的碎片,反而会增加碎片,估如果压根收缩数据文件时最好是在你做了一次数据量大的表后,这样会有好处,否则不建议这么做。另在基于行版本控制的隔离级别下运行的事务可能会阻塞收缩操作。

做法二

  1. 将数据库模式设置为:简单模式。
  2. 对数据库进行收缩,主要是收缩日志。
  3. 重新改回:大日志模式,这样可以保证发生异常时日志可做为恢复依据。

两种做做法各有千秋,做法一针对数据文件、做法二针对日志文件。

相关日志

Categories: 技术.

Tags:

Comment Feed

No Responses (yet)



Some HTML is OK

or, reply to this post via trackback.

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word