Moving a Database to a new SAN involved in an AlwaysOn Cluster with minimal downtime

  • Hi,

    Just throwing this out there to see if anyone can help - a new pair of eyes and all that 🙂

    I have had a request to move a 2TB database (lets call it DB1) which is involved in a 2-node AlwaysOn Cluster (SQL1 and SQL2) to new flash storage but keeping the databases on the same instances.

    I could go down the road of database backups/restores or copying the mdf/ndf files to the new storage but that would mean a long outage during that time.

    What I was thinking was to restore a backup of DB1 to SQL1 and SQL2 and calling them DB_2 and keeping then in restoring mode and keep applying logs to them from DB1 to keep them in sync.

    Then when I am ready to change over to the new storage I take DB1 out of the AlwaysOn Availability Group on SQL1 and SQL2, apply the last logs to Db_2 on SQL1 and SQL2, take the DB_2 database on SQL1 out of restoring mode and rename it DB1....

    But now my issue - how can I rename the DB_2 database on SQL2 to DB1 to allow me to add it back into the AlwaysOn group. I won't be able to rename the database when it is in restoring mode.

    Any help would be greatly appreciated - I will be testing in the meantime..

    Cheers!

  • From what i understand, you seem to have got the ducks in a row. Awesome way to minimize the potential down.

    Have you thought of using a powershell script to rape remaining steps. This way you might reduce the time to bring the DB to AG by a few more ticks

    - Removing DB1 from AG

    - DB1 goes offline to app

    - Tack tran log backup off DB1

    - DB1 goes offline

    - Restoring the DB1 log to DB_2

    - Renaming the DB_2 at SQL1,SQL2

    - Adding the renamed DB to AG

    - More steps ....

    There is also the more costly way of doing things

    - Introduce 2 new secondary replicas to the AG with DB1

    - Failover to a one of the new replicas when time's up

    - Remove the two old replicas from the AG and decommission

    Hope that made sense.

  • Hi Jude,

    Thanks a lot for your reply. Appreciated.

    My issue will be when I go to rename the DB_2 database on SQL2 to DB1 so I can add it into the AG Group to sync with the newly renamed DB1 on SQL1. I won't be able to rename that database as it will be in RESTORING mode.

    I won't have an issue renaming the DB_2 to database to DB1 on SQL1 as this will be the Primary DB.

    This is where my logic falls over :angry:

  • HI

    I might have you'r logic a bit fuzzed up in my head 🙂

    Just to clarify

    - How do you plan to rename DB_2 to DB1 + restore the latest logs to the new db without a application outage

    - Do you plan to have the renamed DB with different physical file names or do you plan to cahnge them ?

  • Hi Jude,

    There would need to be a small outage during the reply of the final logs but it would be minimal compared to the time of coping across the 2TB database.

    I haven't been able to work out a way to rename the restoring copy of the DB_2 on the AlwaysOn Secondary, SQL2 to DB1 to allow it to sync with the DB1 copy on SQL1 :angry:

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

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