locked
DB Mirroring failover for ODBC RRS feed

  • Question

  • HEllo, I am novice in .NET. I am not sure wether this is right place or not. Please help me

    I have database mirroring in sql 2005-sp3. last friday fail over happened to one of my database. So
    my database was up and running but on different server.
    Monday morning, i heard users are not able to access app. coz app is pointing to a database which was on server-A.
    (but now db is on server-B). When I ask developers to use fail over partner in app. he said its an old app. using ASP and
    ODBC cennection so no way I can use failover.

    My question is, Is it possible I can use 2 ODBC for server-A and server-B and write a code that switches when failover
    occurs. OR is there any other way I can make it automatic from application?? Please let me know. Thanks

    Monday, June 14, 2010 6:51 PM

Answers

  • Hi cottage,

    When you're using Mirrorring you need to add the network attribute to your connectionstring. Also you need to specify the failover_partner in your connectionstring. It would like to be this:

    "Server=192.168.0.1; Failover_Partner=192.168.0.2; Database=<your_db>; Network=<network_library>"

    The reason why I used IP addresses is that when the first server is down, it takes more time to do a DNS lookup, so use IP Addresses. Also it is better to use TCP/IP instead of named pipes.

    Hopefully this will help you out.

    Regards

    • Marked as answer by SamAgain Tuesday, June 22, 2010 8:40 AM
    Monday, June 14, 2010 9:18 PM

All replies

  • Hi cottage,

    When you're using Mirrorring you need to add the network attribute to your connectionstring. Also you need to specify the failover_partner in your connectionstring. It would like to be this:

    "Server=192.168.0.1; Failover_Partner=192.168.0.2; Database=<your_db>; Network=<network_library>"

    The reason why I used IP addresses is that when the first server is down, it takes more time to do a DNS lookup, so use IP Addresses. Also it is better to use TCP/IP instead of named pipes.

    Hopefully this will help you out.

    Regards

    • Marked as answer by SamAgain Tuesday, June 22, 2010 8:40 AM
    Monday, June 14, 2010 9:18 PM
  • Hi,

      Thanks for your post. Please consider Database Mirroring forum as a better option.


    Please mark the right answer at right time.
    Thanks,
    Sam
    Tuesday, June 22, 2010 8:40 AM