attach/detach with mutliple logfiles

  • i was moving some databases to the SAN and ran into an issue on a database which someone else was maintaining.

    It has 1 datafile, but 2 logfiles..

    so i detached it.. moved the datafile and the logfiles, then tried to reattach the database, but it wouldn't reattach the 2nd logfile from the new location, it wanted to go from the old location.

    Can someone tell me how to attach a database with multiple log files?

    Thanks

    --------------------------

    I long for a job where my databases dont have any pesky users accessing them 🙂

  • hard to say why, post the error. You sure you have got new path correct.

    That said there is no reason to have two log files. Get rid of the second log file before you detach it:

    dbcc shrinkfile(logicalfilename,emptyfile)

    alter database dbname remove file logicalfilename

    ---------------------------------------------------------------------

Viewing 2 posts - 1 through 1 (of 1 total)

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