SQL Mirroring Fail-over

In certain scenarios, a mirror will break after fail-over and the mirror endpoints need to be restarted: https://support.microsoft.com/en-us/kb/2490051
The easiest fix is to use the following on both primary and secondary:

 

--get the name of your mirror endpoints
select name from sys.database_mirroring_endpoints


-- stop and start them
ALTER ENDPOINT Endpoint_Mirroring STATE=STOPPED;
GO
ALTER ENDPOINT Endpoint_Mirroring STATE=STARTED;
GO