Sql-server – Initial Database Size Too Big

shrinksql serversql-server-2016standard-edition

I have a clustered SQL 2016 standard database. It is set up in a virtual environment with a total of 250 GB of storage. However, my developer set the initial size of the databases to be 100 GB. There are two databases (200 GB total), using 40 GB and 20 GB, respectively.

I am unable to run a backup due to the large initial database size. I have read multiple articles about how shrinking the database is against best practices including 'Stop Shrinking Your Database Files. Seriously. Now.' but I don't see any other options.

Can someone assist? My plan is to run the command DBCC SHRINKDATABASE down to a size just larger than the databases are now and then rebuild the index. I appreciate any suggestions.

Best Answer

As others have said, shrinking a database in this situation is not at all inappropriate.

What the experts mean when they say things like "Stop Shrinking Your Database Files. Seriously. Now." is that you don't want to shrink them just because they are a little bit bigger than you expect. You want to make sure you know why your database is "too big" before you shrink it. Otherwise, you're only treating the symptom, not the disease.

For example, maybe a big weekly data import causes your database to grow by 200 GB every Sunday, and then a consolidation removes 195 GB of that data every Monday. If you look at your database on Tuesday, it'll seem to be much bigger than it needs to be. But if you shrink it, it'll just grow back on the following Sunday.

In the case presented in this question, the size of the databases is the result of an erroneous initial setup, rather than the result of normal activity. As such, shrinking it makes good sense.