Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a database which is the recipient of a logshipping process.

The database is in 'restoring'. Is it possible to move this database?

EDIT Just to clarify what I meant by move. I mean to make a copy of the database and transfer it to another server without breaking the logshipping process.

The reason for this is to run analysis queries against the database. I have tried using Copy Database Wizard but got stuck in the process. You can read about that problem here

share|improve this question
    
subject says 'move' but then your edit says 'copy the database' which is it? –  Nick Kavadias Apr 14 '10 at 14:59
    
as per the edit, i meant copy –  Nai Apr 15 '10 at 8:25

2 Answers 2

up vote 1 down vote accepted

Never actually tried it, but this describes the method I would think would work. It depends on it NOT being in Standby mode (i.e. if you can connect to the recipient right now with read access, you'll need to fiddle with it to change it to Norecovery mode)

This is also assuming that "move" means move to another drive/directory on the same server. If you're talking another server, then No.

But to be honest, I would use this an exercise to test and update those documents that describe how to rebuild the standby server and re-restore from a full backup.

EDIT BASED ON YOUR EDIT : Yes, you could stop SQL, copy the MDF and LDF to another server and attach them, restart SQL and log shipping should not be affected

But if you have an on-going need to do this, you could change the log shipping to set the database to standby, which would allow you to do your analysis queries against the active log-shipping recipient database, as long as they are read-only queries, and you deal with the fact that log-shipping will be suspended while you are connected to the database.

share|improve this answer
    
cool, i'll test this in a bit but this sounds good! –  Nai Apr 13 '10 at 10:09
    
yeah erm that didn't work due to the database in a restore/ read only mode –  Nai Apr 21 '10 at 8:18
    
what didn't work? did the stop SQL & copy files approach not work? after you've attached the files it should then be a case of running "Restore database dbname with recovery" against the new copy to bring it to a usable state. –  Chris W Apr 21 '10 at 8:39
    
Let me re-run what I did and get the actual error message out. But basically, I stopped the service, copied the .mdf, .ldf and .ndf files over. Went into SMSS and restored from there but met the restore/read-only error in the process. Will report back in an hour or so with findings. –  Nai Apr 21 '10 at 9:29
    
Make sure the .mdf, .ldf and .ndf files are writeable when you attach them, if you use cdrom to copy them over they mave have read-only bit set; also when you attach you can use any database name, if there is already a db there with the target name.You might need to do a "restore database xxx with recovery" after the attach. –  SqlACID Apr 21 '10 at 11:03

Yes and no. By definition 'making a copy of the database' is not moving it. I think what you ultimately want to do is setup a second log shipping destination from the principal server. You can use log shipping to send the logs to two different places. You would set this up just as you originally set up your current instance.

share|improve this answer
    
I can't do this because I don't have active directory set up and I kinda hacked my local server to have the same user/pass as my primary DB. I can't do this for my other server (the analysis server). –  Nai Apr 21 '10 at 8:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.