码迷,mamicode.com
首页 > 数据库 > 详细

What is the difference between Shrink Database and File?

时间:2020-03-12 18:24:26      阅读:77      评论:0      收藏:0      [点我收藏+]

标签:perl   size   cell   HERE   tween   mdf   clear   imp   stack   

What is the difference between Shrink Database and File?

Simply...

  • DBCC ShrinkDatabase(): shrink all files
  • DBCC ShrinkFile(): just one file

For example, you may have a log backup issue and it‘s grown out of control so you run DBCC ShrinkFile().

You almost never use ShrinkDatabase.

Before you consider using either command, please read Paul Randal‘s blog on shrinking.

I‘d shrink neither one of the files (mdf, ldf) unless there was a clear reason. The files are the size they are because they need to be. Any blogs suggesting to do so as part of regular maintenance probably don‘t understand how SQL Server works.

 

What is the difference between Shrink Database and File?

标签:perl   size   cell   HERE   tween   mdf   clear   imp   stack   

原文地址:https://www.cnblogs.com/chucklu/p/12471103.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!