SQL Server Database Mirroring - Doing a failover to bring the Mirror Server Online (switch roles)



Doing a Manual Database Failover

-- DatabaseName: AdventureWorks

-- To run on the Principal
ALTER DATABASE AdventureWorks SET PARTNER FAILOVER

Changing a Mirror database to Principal (High Safety Mode)

-- Changing Mirror of AdventureWorks database as primary.
-- Command to be run on the mirror server.
ALTER DATABASE AdventureWorks 
    SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS
RESTORE DATABASE AdventureWorks WITH RECOVERY

Changing a Mirror database to Principal (High Performance Mode)

-- Changing Mirror of AdventureWorks database as primary.
-- Command to be run on the mirror server.
ALTER DATABASE AdventureWorks SET PARTNER OFF
RESTORE DATABASE AdventureWorks WITH RECOVERY

Share |

 Cant find the page you are looking for?
 Help us to improve by adding the content that you are looking for.
 Leave a feedback
 We look forward to hear your comments and feedback.