Shrink Database Files By Small Amount

It is not recommended to shrink database files. But sometimes it becomes necessary to shrink a database file. Because it is not needed that much free space any more.


If the case is to shrink a database file, shrink it by small amount. Because if you try it to shrink at once, it takes much more time.

Let's say that we have a database file which has a size of 120 GB and only 20 GB is used. And we want to reduce its size to 45 GB.

If you try to shrink the file at once, it may take hours. First shrink it by 1 GB. If the duration is acceptable, then 2 GB ... then 5 GB. If 5 GB is  acceptable finish the work by 5 GB.

This is my experience. You can find your best practice, but this is mine. If a step of shrink lasts longer then 5 minutes then stop it. If you choose smaller amount, total time will be lesser.

Log file is shrunk very quickly. You can shrink log files by big amounts. But again start shrinking by small amounts.



No comments:

Post a Comment