O'Reilly logo

Brad's Sure Guide to SQL Server Maintenance Plans by Brad McGehee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Shrink Database Task

In Chapter 3, I recommended that you never use the Shrink Database task, and that advice stands firm. In this brief chapter, I will describe exactly what is meant by "shrinking a database," and why I advise against doing it using the Shrink Database task in the Wizard. I will also explain the legitimate reasons to shrink your databases, and the right ways to do it.

Sizing Your Database Files

A database is composed of at least two physical files: one MDF (data) file where data is stored, and one LDF (log) file, where the transaction log is located. A database can actually have more than two physical files but, for the sake of this discussion, we'll assume it comprises one MDF file and one LDF file.

When a new database ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required