connection strings in case of failover

  • Hi All, I am so confused about configuring connection string when we want to configure db mirroirng or replication. how application will detect that it needs to send the connection to new (failover) server? might be a silly questions for all the gurus out there... please advise

  • with replication you have a manual failover action, depending upon your mirror session type this will also be either manual or automatic failover. For sessions using a witness you may leverage the Failover Partner option in the database connection string. This will be dependant upon your connection type (ADO.NET, SQL Native client).

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

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

  • Perry Whittle (5/14/2012)


    with replication you have a manual failover action, depending upon your mirror session type this will also be either manual or automatic failover. For sessions using a witness you may leverage the Failover Partner option in the database connection string. This will be dependant upon your connection type (ADO.NET, SQL Native client).

    do you have to have a witness to make use of the Failover Partner option?

    Data Source=myServerAddress;Failover Partner=myMirrorServerAddress;Initial Catalog=myDataBase;Integrated Security=True;

    i thought that worked without a witness too?

  • Automatic failover is only possible with a witness and high safety mode.

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

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

  • I know that, But manual failover still changes server names on the app side.

  • Correct. Automatic failover is not required to use the Failover Partner attribute in the connection string.

    For replication, I recommend using load balancing in front of the replicated servers. This gives you the ability to redirect clients to an alternate server without them being aware. The clients/apps would connect to the DNS virtual name and would not need to know the name of the server they are on.


    My blog: SQL Soldier[/url]
    SQL Server Best Practices:
    SQL Server Best Practices
    Twitter: @SQLSoldier
    My book: Pro SQL Server 2008 Mirroring[/url]
    Microsoft Certified Master: SQL Server, Data Platform MVP
    Database Engineer at BlueMountain Capital Management[/url]

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

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