Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Move Data files from D: to E: (w/ replication in place)

Status
Not open for further replies.

Firecat1970

IS-IT--Management
May 25, 2003
68
HK
Dear experts,

I have a database with physical data/log files sitting on d: drive for instance. We have replication setup on this database.

We would like to move the physical data/log files to e: drive, and we are thinking of detach/copy/attach approach, but since the replication is in place, we are not allowed to.

Is there any easy way we can achieve this, yet keeping the replication intact after the move? (i.e. no need to re-setup replication, since database name is the same, just physical files relocation)

Best Regards,
Harrison
 
Well if you can stop/disable the scheduled jobs that do the actual replication, you should be able to detach, move, reattach and then re-enable the scheduled jobs. If your primary DB is going to be down while this is happening there wont be any changes or items to replicate during the move because the db will not be attached.

I'm not a big replication expert but I think that should work. Anyone else have a thought or two?
 
Thanks. I gave it a try on a small DB. It works!

- Generate SQL script of replication
- Delete the replication
- Detach DB
- Move physical file somewhere
- Re-attach DB
- Run the script to re-generate replication job
- Bingo
 
You can't detach a database while the replication is in place. You'd have to drop the replication then detach the database.

In theory you could backup and restore the database with the KEEP_REPLICATION flag. I've never tried this, but it "should" work. This is something that you'd want to test first.

Denny
MCSA (2003) / MCDBA (SQL 2000)

--Anything is possible. All it takes is a little research. (Me)

[noevil]
(My very old site)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top