I need to move few DB files to another location on same server due to low disk space. Replication is present with that DB and this scenario is on subscriber server. Is there any way to do this without doing reconfiguration?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
migrated from stackoverflow.com Nov 23 '11 at 6:20
This question came from our site for professional and enthusiast programmers.
Here's how I'd do it:
If you want to be really clean about this, you can stop the distribution agent while the database is offline and restart it when it's back online. But that's not necessary. Just so you know, I've also done this with a distribution database and would imagine that it would work fine with a publisher, too.
You should be able to do this by altering the clustered index and pointing it to be created on SECONDARY filegroup instead of the PRIMARY. The clustered index is what specified where the physical data is stored. Create a new filegroup in your database called SECONDARY and point it to your other location. Use CREATE INDEX ....... WITH DROP_EXISTING on your clustered index specify the new filegroup in the ON clause.
Download some SQL to move lots of tables to another filegroup here: Adam Haines