Sql-server – Index Rebuilding Log File Growth

indexsql-server-2008-r2transaction-log

I would like to start running regular index maintenance on a server that has been running for a while without it. The database is running in FULL recover with log shipping. The problem I am having is log space. The partition holding the log does not have the room to hold all of the growth that will occur during the index maintenance.

So far I have come up with two solutions. The first is rebuilding the big ones manually during my weekly maintenance window until I get them under control. This will take a very long time and be time consuming to do. The second is switching the database to SIMPLE during my maintenance window. This is not ideal but seems to be my best bet for getting this done in a short period of time.

Are there any other solutions to this problem?

Best Answer

So your database is in full recovery model then? You can script out the rebuild commands for the index and have a pause command to wait for the next log backup to complete. This would rebuild at most one index at a time. It would be slow but could be done during the evening and would get you caught up faster.