User redirection in DB Mirroring

  • I have configured DB Mirroring with automatic fail over.My users are connected to Server_A .My Partner is Server_B and witness is Server_C.As we know that whenever a fail over occurs Server_B will take the roll from Server_A and it becomes Online.But my point is how the users are redirected to Server_B.

    Is it the DBA who changes the connection string or the Application Developer or the Database Developer.How ? What happens behind the screen.Please explain this with details..

  • 'Out of the box' its a manual process, if you have server names in the connect string for your app pointing at serverA then it will need to be manually changed to ServerB (My vote is App support should be responsible for this, but it will vary between companies).

    One (of many i'm sure) way to potentially make this simplier could be to use a DNS alias for the application connect string, so when you fail over, change the DNS entry to point at ServerB...although would still be a manual process, its only a single change to make.

    Rod

  • usually, the app developer will put a "failover partner" in the connection string for the application. When the primary goes offline, e.g. the server blows up, and the application cannot connect to the database, it will try the server specified by the failover partner.

    I'd personally only use DNS redirection when you don't have automatic failover setup.

  • Very good point, The failover partner makes much more sense when witnesses are being used. We tend not to have auto failover due to our network 'setup'.

    Rod

  • skpani (8/22/2013)


    I have configured DB Mirroring with automatic fail over.My users are connected to Server_A .My Partner is Server_B and witness is Server_C.As we know that whenever a fail over occurs Server_B will take the roll from Server_A and it becomes Online.But my point is how the users are redirected to Server_B.

    Is it the DBA who changes the connection string or the Application Developer or the Database Developer.How ? What happens behind the screen.Please explain this with details..

    There should be no need to modify the connection string due to a failover from principal to mirror. If the connection string is setup to include both the principal and failover servers, the application itself will manage the switch as needed with no outside intervention required.

    The only time the connection string would need to modified would be if the connection string contained only the server name for the principal server and no partner server was included and it was the first time a client was attempting to connect and the named server was unavailable.

    Read more here:

    http://msdn.microsoft.com/en-us/library/ms366348(v=SQL.100).aspx

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

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