SQL Mirror Failover question

  • SQL 2008 Ent running on Windows 2008 Server.

    I have a sync mirror configured (A is principal and B is mirror, no witness). I’m leveraging the FailoverPartner=B in the connection string.

    I’m able to failover between the partner / mirror successfully.

    Information:

    Initiate Failover from principal to mirror. Database B is now the principal.

    Server A – SQL is running, database on server A is now in a Mirror,Synchronized/Restoring state.

    Issue – Application still pointing to A. The connection string points to the initial principal (Database A – which is now the mirror but I have the FailoverPartner=B). I see login failures in the SQL Error log on A. ( Login failed for user 'username'. Reason: Failed to open the explicitly specified database).

    I then stopped SQL Services on A and the now the connection points to B.

    So – is there a way to force the connection to the principal after failover w/out having to stop SQL Services on the initial Principal (which is now the mirror)?

  • for the "FailoverPartner=" clause to work you must be using ADO.NET or SQL Native client for your database connection!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • I'm using an ADO connection. The connection works fine when the initial principal SQL service is stopped.

    The issue we're facing is the connection doesn't point to the 'new principal' after failover if the 'initial principal' has sql services running.

  • you should also add to your ado connection string....

    connectionString.NetworkLibrary = "dbmssocn"; connectionString.Pooling = false;

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply