SQL Server Developer Center > SQL Server Forums > Database Mirroring > Switching Back principal and mirror after failover
Ask a questionAsk a question
 

AnswerSwitching Back principal and mirror after failover

  • Tuesday, July 28, 2009 9:53 AMYitzhakov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    hi,

    I've setup a database mirroring with a principal, mirror and a witness.

    When the principal loses connection, the mirror successfully becomes available, as it should be.
    When the principal restores the connection, it becomes the mirror.

    What I would like to happen is that when the original principal comes back online, it will become available and a principal and the mirror (which was the principal while the original one was offline) will become the mirror again.

    Is that possible ?

    Thanks.

    Dror Yitzhakov.

Answers

  • Tuesday, July 28, 2009 12:17 PMSudeepta Ganguly Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Only if the principal server (which was earlier a mirror server) goes down, than it will again changed back. This is the feature of mirroring with witness.

    Sudeepta Kumar Ganguly. sudeeptamcsa@gmail.com
  • Tuesday, July 28, 2009 8:49 PMMichael_W Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You can do it by monitoring the state of the original principal from the original mirror.  Setup an alert to watch for the mirror (old principal) to be up and when it fires issue the command to failover.  I don't have the background on why you would want to do this, but I don't see why you couldn't do it.


    -Mike

    • Marked As Answer byYitzhakov Sunday, August 02, 2009 7:27 AM
    •  

All Replies

  • Tuesday, July 28, 2009 12:17 PMSudeepta Ganguly Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Only if the principal server (which was earlier a mirror server) goes down, than it will again changed back. This is the feature of mirroring with witness.

    Sudeepta Kumar Ganguly. sudeeptamcsa@gmail.com
  • Tuesday, July 28, 2009 2:25 PMYitzhakov Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Isn't there a way to do what I want to do?
    Dror Yitzhakov.
  • Tuesday, July 28, 2009 8:49 PMMichael_W Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    You can do it by monitoring the state of the original principal from the original mirror.  Setup an alert to watch for the mirror (old principal) to be up and when it fires issue the command to failover.  I don't have the background on why you would want to do this, but I don't see why you couldn't do it.


    -Mike

    • Marked As Answer byYitzhakov Sunday, August 02, 2009 7:27 AM
    •  
  • Wednesday, October 14, 2009 9:34 PMRoshall Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Or you can manually fail it back yourself from SSMS.  Once the original principal is back online and insync with the new principal (old mirror), SQL Server will let you fail back.  there's a button in database properties that allows you to failover to get your environment back to the original configuration.

    HTH
    Roz