none
Native Client on Linux does not recognize Failover_Partner in connection string

    Question

  • We are having a problem with Failover_Partner on Linux ODBC. We are using perl 5.14.2 on Ubunto 12.04.3 and unixodbc 2.3.2.

    When the primary server is unavailable we expect the driver to automatically switch to the server listed as the Failover_Partner but we get an error message "[Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute" instead. The connection string we are using is

    dbi:ODBC:DRIVER={SQL Server Native Client 11.0};Server=Server_B;Failover_Partner=Server_A;Network=dbmssocn;Database=myDatabase;

    Note 1: Server_A is the primary server and is up and running. Server_B is the mirror server and is not available. This should cause the driver to do a switch. We originally tested with Server=A and Failover_Partner=B but we had to fail the DB and this was not something that we could continue to do while we tried to debug this problem.

    Note 2: even though Failover_Partner is supposed to be the correct spelling for ODC, we've tried all of the other documented spellings to no avail.

    [ODBC]
    Trace=Yes
    TraceFile=/tmp/sql.log
    ForceTrace=No
    Pooling=No

    [SQL Server Native Client 11.0]
    Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
    Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
    Threading=1
    UsageCount=1

    We've also tried the driver named msodbcsql-11.0.2260.0 with the same results.

    Any suggestions? Is Failover supposed to work with the native driver on Linux?

    Thanks, Borden Covel

    Friday, November 01, 2013 11:24 PM

All replies

  •  "[Microsoft][SQL Server Native Client 11.0]Invalid connection string attribute"


    haven't used perl, don't know its connect str, may refer to perl doc about connection str
    Monday, November 04, 2013 7:26 AM
  • We are using a similar connection string with the Failover_Partner option with Perl on our Windows servers and it works fine (using the windows native driver), so I don't think it's a Perl issue. All indications are that it is a Native Diver for Linux problem. Anybody from MS have any thoughts about this? Thanks!

    Tuesday, November 05, 2013 6:26 PM
  • as per

    http://msdn.microsoft.com/en-US/library/hh568455.aspx

    When connecting to a database that uses database mirroring (has a failover partner), do not specify the database name in the connection string. Instead, send a use database_name command to connect to the database before executing your queries.

    Try removing database name from there and try.


    Thanks, Dilkush Patel Microsoft SQL Developer Support Microsoft Corporation

    Wednesday, November 06, 2013 7:08 PM
  • Thanks for the input. Since mirroring is done on a database level, when I remove the selection of the database from the connection string the driver has no idea whether or not the database that I want to connect to has failed and it would have no way to automatically switch to the alternate server. Please note that a connection string with the database selection and failover_partner does work on Windows using the windows native driver.
    Thursday, November 07, 2013 10:35 PM
  • This needs testing on how it will work, I will try to get Linux VM box and see if i can test this feature.

    yeah it does work on Windows box and when i comes to unix box it will have it's own limitation.

    If I could test it properly i will update results.


    Thanks, Dilkush Patel Microsoft SQL Developer Support Microsoft Corporation

    Sunday, November 10, 2013 2:55 AM
  • Dilkush - Have you been able to determine if the Failover_Partner option is supposed to work on the native driver for Linux? Thanks!

    Tuesday, December 03, 2013 2:12 AM