mirroring RRS feed

  • Question

  • If My mirror server fails some fraction of seconds,how can i restore data in between failure.
    Sunday, September 15, 2013 1:17 PM


  • Hello,

    I'm not sure I understand your question. If your mirror server fails (the mirror is the secondary server) there is no data loss on the primary. You'd be running exposed (primary only) but nothing terrible would automatically happen.

    If you're asking what would happen if the primary failed (synchronous), then all in-flight transactions would be rolled back. There is no way to handle this inside of the database, the application *should* (most don't) have logic to see that the transaction failed and to retry. There is nothing you can do about this, it's up to the application.

    If you're asking what would happen and the mode is asynchronous mirroring then you could lose data if the primary and mirror are not in sync. The only way to get the data back at that point would be to bring the primary server back up but disable mirroring. Once it's disabled you can create something such as a database snapshot or backup the database and restore it as a copy and sift through the records manually (or automated if you have a process). If the server comes back up and mirroring is established then the old primary (now the mirror if the failover was done manually, resulting in possible data loss) would rollback to the LSN of where the new primary took over in a consistent state and logs would be sent from that point on. If this happens, you won't be able to recover that data, hence the need for a snapshot or backup before the mirroring is established again.


    Sean Gallardy | Blog | Twitter

    • Proposed as answer by Uri DimantMVP Monday, September 16, 2013 5:20 AM
    • Marked as answer by Fanny Liu Saturday, September 21, 2013 10:42 AM
    Sunday, September 15, 2013 3:40 PM