sql-serverdatabaseshrink

A bigger database has almost all disk space but 54% of free space on it. Do I have to shrink it?


I have received a database management procedure on SQL and the database has with more than 440 Gbytes of space and the disk is just for 500 Gbytes so there is almost no free space on disk to run tasks and to have a good space for temporary files. The database has more of 54% of free space internally. I know that it is not a good idea to shrink database or files but, what other solution exists? (not involving a new hardware) Do I have to "shrink" sql databases or files now?


Solution

  • Yes, db shrink is a bad thing bla bla, but Given the situation you are in, I think you are ok to Shrink the database but also keep an eye out what causing the database to bloat like this ? Maybe a process that create some tables and drop them later.

    Also, once you have shrunk the database you must do an index rebuild on the database, because shrinking the database fragments the indexes really badly.

    In most of the article you read online, they have said that it is a bad practice to shrink databases, yes, if you are shrinking databases as a scheduled task to free up disk space, this is wrong.

    But the situation you are in, it makes perfect sense to shrink the db.