We have a Database Mirroring setup between PROD
and SECONDARY
and we have failed over to the secondary replica (SECONDARY
) . We are now getting a number of almost constant failed logins showing in the log of the server PROD
.
The applications use the Failover Partner property of the connection string:
Data Source=PROD;Failover Partner=SECONDARY;Initial Catalog=myDataBase;
and we have confirmed that they are working as expected.
It makes sense that the explicitly specified database on PROD
cannot be opened as it is in a restoring state due to being failed over but the app is connecting successfully to SECONDARY
. Is this error message expected behaviour on a failed over database mirroring primary replica?
Below replicates the problem using a simple, ODBC based scenario
Set up a Mirorred database:
create a login on the primary
USE Mirroring
CREATE LOGIN MirrorUser WITH PASSWORD = 'MyPassHere', DEFAULT_DATABASE = 'Mirroring'
CREATE USER MirrorUser
ALTER ROLE db_datareader ADD MEMBER MirrorUser
and the secondary:
CREATE LOGIN MirrorUser WITH PASSWORD = 'MyPassHere',SID = <Sid from primary here>
Set up a linked table in an Access database
Failover the database to the secondary:
ALTER DATABASE Mirroring SET PARTNER FAILOVER
Open the Access linked table and verify we can see the data after the failover:
Observe the error on .\PROD