Shrinking database without impact to performance

  • Hi all,

    My database has 220GB, but there is 75Gb free space (in mdf) - we dropped one big table and the space won't be used soon.

    How to do it without fragmenting indexes ? I have tried it with a copy of it, but DBCC SHRINKFILE defragments most of indexes , after reindex still a lot of them are much more fragmented then now.

    It is OLTP, daily usage from 6 a.m. to 6 p.m., so it is possible to do it after working hours.

    I have some ideas like

    a) move tables to another filegroup, shrink the file and move back or

    b) copy tables, then indexes and other structures to another database and rename after, but this is really a lot of work.

    I always avoided shrinking database, but now i need it at the moment and there must be a way how to do that.

  • This might be a case where I'd just go with it.

    Shrink, rebuild all.

    hopefully you can have a 60+ hours window on the w-e to make absolutely sure it all runs in 1 go.

    I'd also increase the tlog backups frequency.

    I don't know how fast your san is, but this is going to take a while!

    Caveat, only 75GB is not a lot of free space (±50% of the current data size). I might just leave it as is unless I'm really getting short on HD space.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply