Home Forums SQL Server 2012 SQL 2012 - General Re-Indexed with the Wrong Fill Factor and Now All Databases Are Huge RE: Re-Indexed with the Wrong Fill Factor and Now All Databases Are Huge

  • You will have to re-index before you can shrink the databases, and then again afterwards to remove index fragmentation.

    Although there is a lot of space available in the database, is is mostly in 90% empty database pages.

    ShrinkDB will only remove completely empty pages, so you will need to do the following:

    1. Reindex all tables using the 90% fill factor to free up empty pages that can be removed by the shrink.

    2. Shrink the database leaving a little bit more free space than the size of the largest table in each database.

    You may find the script on the link below useful to make the shrink process a little less painful.

    Shrink DB File by Increment to Target Free Space

    http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=80355

    3. Reindex all tables again using the 90% fill factor.