Relocating the Log file of a merge subscription database.

  • Hello,

    I need to move the log file of a disk and onto another disk. The log belongs to a merge subscription database.

    I was going to stop/disable the merge jobs on the distributor, detach the database, move the log file to another drive, reattach, and enable the merge jobs on the distributor.

    Does that sound ok, or should I employ some other method.

    Thanks,

    Regards,

    D.

  • Duran (3/31/2015)


    I was going to stop/disable the merge jobs on the distributor, detach the database, move the log file to another drive, reattach, and enable the merge jobs on the distributor.

    Does that sound ok

    No, definitely not, do not detach the database.

    Duran (3/31/2015)


    or should I employ some other method.

    Thanks,

    Regards,

    D.

    Use the ALTER DATABASE ... MODIFY FILE

    command to move the database file in the system catalogs. Take the database offline and then move the file at the OS level to the new location then bring the database back online.

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Thanks Perry, this is what I did.

    Regards,

    D

  • No, definitely not, do not detach the database.

    Sorry to jump in on this thread, but can I clarify if this is the recommended way to do this job just for a database which is involved with replication, or is this the recommended practice for moving the files of any database? If the latter, why is it better to change the catalog rather than dettach/attach?

  • Maddave (4/10/2015)


    Sorry to jump in on this thread, but can I clarify if this is the recommended way to do this job just for a database which is involved with replication, or is this the recommended practice for moving the files of any database?

    In SQL Server 2000 you didn't have the option of using the alter database command to move a user databases files it was only available on tempdb.

    Maddave (4/10/2015)


    If the latter, why is it better to change the catalog rather than dettach/attach?

    The alter database command from 2005 on is the Microsoft supported way to move database files, that's why they put it there 😉

    Detaching a database and re attaching usually issues a new database id this can interfere with replication databases and mirrored databases, see this link for more info on Detach

    Also see my guide on this site at this link[/url]

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Interesting. Thanks for the reply.

  • you're welcome

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

    "Ya can't make an omelette without breaking just a few eggs" 😉

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

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