How to Failover the instances in Mirroring
Mirroring is the high availability technique followed across the SQL Server platform which more efficient and reliable.
Mirroring is configured on the databases which are having 'FULL RECOVERY MODEL' as recovery option.
Failover will make the Principal server as Mirror server and Mirror server as Principal server as soon as the command is executed.
When compared to Logshipping this is the best way for Disaster recovery servers to minimize the downtime of outage in production systems.
We can issue failover command from either GUI or through TSQL command.
GUI Method is shown in below screenshot:
In the above screenshot, Click "FAILOVER" button and pop window will ask for confirmation. Once clicked YES, failover takes place between PRINCIPAL and MIRROR Datatabases.
TSQL Method:
Above Screenshot shows the TSQL method, in which command is executed and failover of databases was successfully performed as shown.
Command should be executed in the MASTER database.
TSQL Command:
Use Master
Go
Alter database AdventureWorks
Set Partner Failover
Go
Hope the above information helps.
Thanks