What is the difference between Shrink Database and File?

Posted chucklu

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了What is the difference between Shrink Database and File?相关的知识,希望对你有一定的参考价值。

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?的主要内容,如果未能解决你的问题,请参考以下文章

What is the difference between Reactjs and Rxjs?

What is the maximum length of a URL in different browsers?

What is the difference between sed and awk

What is the difference between sed and awk

What is the difference between J2EE and Spring

What is the difference between Shrink Database and File?