sqlsql-serverfilegroup

Moving Large Tables and All Indexes to a new File Group


I'm looking at implementing File Groups on an existing database that's roughly 600GB. The largest hurdle I have is actually setting this up in production. I need the database to still be available but moving some of the tables will take a considerable amount of time. In development it took nearly 5 days to move all the indexes to their new homes and then shrink the database.

So what is the best way to implement file groups on a large database where you need to keep the database live?


Solution

  • If you have Enterprise Edition, you can do your rebuilds online. There will still be a short-duration lock taken on the table at the beginning and end of the process, but the table is available for reads and writes for the majority of the duration of the rebuild. So the fact that it takes a couple of days shouldn't really be an issue.