DB Mirroring - Moving MDF and LDF files

  • I have two VM that setup and configure with databasemirroring.

    • Principal and Mirror

    There are SQL Server 2012 SP2 that running on O/S WindowsServer 2012 R2.

    When I was assigned to troubleshooting the performanceissues.  My first initial research, Ifound the MDF and LDF files are located in C drive.

    Then, I am planning to move MDF and LDF files from C driveto  P and L drives.

    I have setup a test lab with Two VM and SQL 2012 mirroring.Then I tried to move the MDF and LDF files.

    But ran into issues and the databases mirroring promptedwarning and error messages when I moved MDF and LDF files.

    Questions:

    • Will Database Mirroring allow to move MDF andLDF files?

    Thank you in advance for your help.

    -Edwin

  • Ed7 - Monday, September 18, 2017 10:10 AM

    I have two VM that setup and configure with databasemirroring.

    • Principal and Mirror

    There are SQL Server 2012 SP2 that running on O/S WindowsServer 2012 R2.

    When I was assigned to troubleshooting the performanceissues.  My first initial research, Ifound the MDF and LDF files are located in C drive.

    Then, I am planning to move MDF and LDF files from C driveto  P and L drives.

    I have setup a test lab with Two VM and SQL 2012 mirroring.Then I tried to move the MDF and LDF files.

    But ran into issues and the databases mirroring promptedwarning and error messages when I moved MDF and LDF files.

    Questions:

    • Will Database Mirroring allow to move MDF andLDF files?

    Thank you in advance for your help.

    -Edwin

    What does the error message say ? I believe you can't move the database files without breaking the mirror.

  • Ed7 - Monday, September 18, 2017 10:10 AM

    I have two VM that setup and configure with databasemirroring.

    • Principal and Mirror

    There are SQL Server 2012 SP2 that running on O/S WindowsServer 2012 R2.

    When I was assigned to troubleshooting the performanceissues.  My first initial research, Ifound the MDF and LDF files are located in C drive.

    Then, I am planning to move MDF and LDF files from C driveto  P and L drives.

    I have setup a test lab with Two VM and SQL 2012 mirroring.Then I tried to move the MDF and LDF files.

    But ran into issues and the databases mirroring promptedwarning and error messages when I moved MDF and LDF files.

    Questions:

    • Will Database Mirroring allow to move MDF andLDF files?

    Thank you in advance for your help.

    -Edwin

    Break the mirror, move the files on the primary, then take a new backup and use to re intialise the new mirror.
    Will save yourself a whole load of time

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

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

  • Thank you, All for your input.  The feedback answered my questions.

  • Hi,
    with minimum downtime I would have done it this way (same solution testet with alwayson ag's)
    1 break mirror and restore mirror partner DB with norecovery moving the files to the new location. restore DIFF and/or log backups with norecovery.
    2 set up mirror again
    3 fail over to the newly restored DB
    4 restore the former primary DB using step 1
    5 set up mirror again
    6 failback or leave it on the other side

    voila - DB moved with minimal downtime.

    BR
    Gerald

Viewing 5 posts - 1 through 4 (of 4 total)

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