Moving LogFile from one disk to another

  • I am trying to move a logfile from one disk to another. I've detached the database, moved the logfile to another disk and reattached the database. I used the sp_detach and sp_attach_db to specify the paths of the *.MDF and *.LDF. I've tried it through Enterprise Manager and with boths ways I get an error message saying: "Error 9003: The LSN (201:48:2) passed to log scan in database 'DatabaseName' is invalid". Does anyone know what this means and how I can get around this. I've even tried to attach the database with the logfile in the original path and I still get that error. Need Help Please!

    Thanks

    Jeff Matthews

    Edited by - jeffbham on 04/11/2002 08:54:39 AM


    Jeff Matthews

  • Jeff,

    Have you tried using the sp_attach_single_file_db method. That way you can forget about the log that is giving you fits for now. The attach will recreate the log in the same path as it was originally and then you should be able to work with the regular detach / attach method for moving the file.

    Hope this helps.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Yes, I used that method to get the Database re-attached, but my problem still exists. I need to move the log file off of one disk to another.

    Jeff Matthews


    Jeff Matthews

  • And the sp_attach with new paths specified is not working with the new log file either?

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • I had made a copy of the logfile and moved it to the new path while renaming the old logfile. Even after running the sp_attach_db and specifying the new path it would not pull the log file in without throwing that error that I mentioned above.

    Jeff Matthews


    Jeff Matthews

  • Sounds like the log file may have been corrupted in some way. Try sp_attach_single_file_db and reattach the data file back that way. From this a new log file will be built. Then detach and try to attach on the other path again. If you get the same please post you code for what you did.

    "Don't roll your eyes at me. I will tape them in place." (Teacher on Boston Public)

  • Jeff,

    This is a way out there guess but could you try attaching the database again using the single file method, backing up the database and the log and then doing a restore from just the database backup using the with move option to point the files where you want them.

    Let me know if this works or you need me to explain further. Thanks.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • Thanks to the both of you. I will be trying both strategies late this afternoon and I'll let you know if this works or not.

    Thanks Again!

    Jeff Matthews


    Jeff Matthews

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply