How to Configure a Freetds Datasource to connect to a High Availability Server

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Configure a Freetds Datasource to connect to a High Availability Server

Funny,Solomon

Good Morning,

 

My company is using a High Availability clustered SQL Server environment.

 

I am trying to create an Freetds ODBC datasource which will connect to the primary server, using the listener name.

 

I can connect using tsql, but when I try to connect using isql, I fail to connect:

 

isql -v  agl-entdbd5 sql005 iam2#nice

[IM002][unixODBC][Driver Manager]Data source name not found, and no default driver specified

[ISQL]ERROR: Could not SQLConnect

 

I did notice on one server there is a file called ODBCDataSources which exists on one server and not on the server where I am having difficulty connecting from (lx-had16).

 

Any advice will be appreciated!!!

 

 

odbc.ini, odbcinst.ini, freetds.conf installed in /etc

 

lx-had16:funnys:/etc> odbcinst -j

unixODBC 2.2.14

DRIVERS............: /etc/odbcinst.ini                            

SYSTEM DATA SOURCES: /etc/odbc.ini

FILE DATA SOURCES..: /etc/ODBCDataSources

USER DATA SOURCES..: /etc/odbc.ini

SQLULEN Size.......: 8

SQLLEN Size........: 8

SQLSETPOSIROW Size.: 8

 

 

Below is the configuration:

 

-----------

odbc.ini

-----------

 

[DELTA]

Driver                     = FreeTDS

Description          = Connect to SQL Server using  FreeTDS Driver

Servername        = NTS-ENTDBD1

Database              = prod01

 

# ENTDBD5 is the datasource name

[ENTDBD5]

Driver                  = FreeTDS

Description        = Connect to SQL Server using  FreeTDS Driver

Servername      = agl-entdbd5

Database            = prod01

 

 

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

odbcinst.ini

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

 

[FreeTDS]

Description = Microsoft SQL Server Access with FreeTDS

Driver = /usr/lib64/libtdsodbc.so.0

 

 

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

freetds.conf

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

 

# NTS-ENTDBD1\DELTA ==> SQL Server Instance

[DELTA]

   host = NTS-ENTDBD1

   instance = DELTA

   tds_version = 7.0

 

# agl-entdbd5 ==> SQL Server Instance

# agl-entdbd5 is the listener name that will connect to the primary replica

[ENTDBD5]

       host = agl-entdbd5

       instance = MSSQLSERVER  =è No named instances on agl-entdbd5, using default instance name

       tds_version = 7.0

#

 

 

Confidentiality Notice: The information contained in this e-mail and any attachments (including, but not limited to, any attached e-mails) may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any part of the contents to any other person.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: How to Configure a Freetds Datasource to connect to a High Availability Server

Daniel Kasak
Firstly, you seem to be calling isql incorrectly. From the man page:

SYNOPSIS
       isql DSN [USER [PASSWORD]] [options]

You're running:
       isql -v  agl-entdbd5 sql005 iam2#nice

 ... which would be looking for a DSN called agl-entdbd5. Maybe what
you mean is:
       isql -v ENTDBD5 sql005 iam2#nice

If this doesn't work, what I usually do is use strace to see what
config files are being read, eg:
       strace isql -v ENTDBD5 sql005 iam2#nice

This will dump a LOT of output. Read through it. On some setups I've
had to create symbolic links from ~/.odbinst.ini to
/etc/unixODBC/odbcinst.ini ( paths may be different on your system ).

Good luck :)

Dan

On Thu, Dec 8, 2016 at 4:52 AM, Funny,Solomon <[hidden email]> wrote:

> Good Morning,
>
>
>
> My company is using a High Availability clustered SQL Server environment.
>
>
>
> I am trying to create an Freetds ODBC datasource which will connect to the
> primary server, using the listener name.
>
>
>
> I can connect using tsql, but when I try to connect using isql, I fail to
> connect:
>
>
>
> isql -v  agl-entdbd5 sql005 iam2#nice
>
> [IM002][unixODBC][Driver Manager]Data source name not found, and no default
> driver specified
>
> [ISQL]ERROR: Could not SQLConnect
>
>
>
> I did notice on one server there is a file called ODBCDataSources which
> exists on one server and not on the server where I am having difficulty
> connecting from (lx-had16).
>
>
>
> Any advice will be appreciated!!!
>
>
>
>
>
> odbc.ini, odbcinst.ini, freetds.conf installed in /etc
>
>
>
> lx-had16:funnys:/etc> odbcinst -j
>
> unixODBC 2.2.14
>
> DRIVERS............: /etc/odbcinst.ini
>
> SYSTEM DATA SOURCES: /etc/odbc.ini
>
> FILE DATA SOURCES..: /etc/ODBCDataSources
>
> USER DATA SOURCES..: /etc/odbc.ini
>
> SQLULEN Size.......: 8
>
> SQLLEN Size........: 8
>
> SQLSETPOSIROW Size.: 8
>
>
>
>
>
> Below is the configuration:
>
>
>
> -----------
>
> odbc.ini
>
> -----------
>
>
>
> [DELTA]
>
> Driver                     = FreeTDS
>
> Description          = Connect to SQL Server using  FreeTDS Driver
>
> Servername        = NTS-ENTDBD1
>
> Database              = prod01
>
>
>
> # ENTDBD5 is the datasource name
>
> [ENTDBD5]
>
> Driver                  = FreeTDS
>
> Description        = Connect to SQL Server using  FreeTDS Driver
>
> Servername      = agl-entdbd5
>
> Database            = prod01
>
>
>
>
>
> -------------
>
> odbcinst.ini
>
> -------------
>
>
>
> [FreeTDS]
>
> Description = Microsoft SQL Server Access with FreeTDS
>
> Driver = /usr/lib64/libtdsodbc.so.0
>
>
>
>
>
> -------------
>
> freetds.conf
>
> -------------
>
>
>
> # NTS-ENTDBD1\DELTA ==> SQL Server Instance
>
> [DELTA]
>
>    host = NTS-ENTDBD1
>
>    instance = DELTA
>
>    tds_version = 7.0
>
>
>
> # agl-entdbd5 ==> SQL Server Instance
>
> # agl-entdbd5 is the listener name that will connect to the primary replica
>
> [ENTDBD5]
>
>        host = agl-entdbd5
>
>        instance = MSSQLSERVER  =è No named instances on agl-entdbd5, using
> default instance name
>
>        tds_version = 7.0
>
> #
>
>
>
>
>
> Confidentiality Notice: The information contained in this e-mail and any
> attachments (including, but not limited to, any attached e-mails) may be
> legally privileged and confidential. If you are not an intended recipient,
> you are hereby notified that any dissemination, distribution or copying of
> this e-mail is strictly prohibited. If you have received this e-mail in
> error, please notify the sender and permanently delete the e-mail and any
> attachments immediately. You should not retain, copy or use this e-mail or
> any attachment for any purpose, nor disclose all or any part of the contents
> to any other person.
>
> _______________________________________________
> unixODBC-support mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Reply | Threaded
Open this post in threaded view
|

Re: How to Configure a Freetds Datasource to connect to a High Availability Server

Funny,Solomon
Thank You Dan,

I will change my isql syntax and try to connect.

Sent from my iPhone

> On Dec 7, 2016, at 6:15 PM, Daniel Kasak <[hidden email]> wrote:
>
> Firstly, you seem to be calling isql incorrectly. From the man page:
>
> SYNOPSIS
>       isql DSN [USER [PASSWORD]] [options]
>
> You're running:
>       isql -v  agl-entdbd5 sql005 iam2#nice
>
> ... which would be looking for a DSN called agl-entdbd5. Maybe what
> you mean is:
>       isql -v ENTDBD5 sql005 iam2#nice
>
> If this doesn't work, what I usually do is use strace to see what
> config files are being read, eg:
>       strace isql -v ENTDBD5 sql005 iam2#nice
>
> This will dump a LOT of output. Read through it. On some setups I've
> had to create symbolic links from ~/.odbinst.ini to
> /etc/unixODBC/odbcinst.ini ( paths may be different on your system ).
>
> Good luck :)
>
> Dan
>
>> On Thu, Dec 8, 2016 at 4:52 AM, Funny,Solomon <[hidden email]> wrote:
>> Good Morning,
>>
>>
>>
>> My company is using a High Availability clustered SQL Server environment.
>>
>>
>>
>> I am trying to create an Freetds ODBC datasource which will connect to the
>> primary server, using the listener name.
>>
>>
>>
>> I can connect using tsql, but when I try to connect using isql, I fail to
>> connect:
>>
>>
>>
>> isql -v  agl-entdbd5 sql005 iam2#nice
>>
>> [IM002][unixODBC][Driver Manager]Data source name not found, and no default
>> driver specified
>>
>> [ISQL]ERROR: Could not SQLConnect
>>
>>
>>
>> I did notice on one server there is a file called ODBCDataSources which
>> exists on one server and not on the server where I am having difficulty
>> connecting from (lx-had16).
>>
>>
>>
>> Any advice will be appreciated!!!
>>
>>
>>
>>
>>
>> odbc.ini, odbcinst.ini, freetds.conf installed in /etc
>>
>>
>>
>> lx-had16:funnys:/etc> odbcinst -j
>>
>> unixODBC 2.2.14
>>
>> DRIVERS............: /etc/odbcinst.ini
>>
>> SYSTEM DATA SOURCES: /etc/odbc.ini
>>
>> FILE DATA SOURCES..: /etc/ODBCDataSources
>>
>> USER DATA SOURCES..: /etc/odbc.ini
>>
>> SQLULEN Size.......: 8
>>
>> SQLLEN Size........: 8
>>
>> SQLSETPOSIROW Size.: 8
>>
>>
>>
>>
>>
>> Below is the configuration:
>>
>>
>>
>> -----------
>>
>> odbc.ini
>>
>> -----------
>>
>>
>>
>> [DELTA]
>>
>> Driver                     = FreeTDS
>>
>> Description          = Connect to SQL Server using  FreeTDS Driver
>>
>> Servername        = NTS-ENTDBD1
>>
>> Database              = prod01
>>
>>
>>
>> # ENTDBD5 is the datasource name
>>
>> [ENTDBD5]
>>
>> Driver                  = FreeTDS
>>
>> Description        = Connect to SQL Server using  FreeTDS Driver
>>
>> Servername      = agl-entdbd5
>>
>> Database            = prod01
>>
>>
>>
>>
>>
>> -------------
>>
>> odbcinst.ini
>>
>> -------------
>>
>>
>>
>> [FreeTDS]
>>
>> Description = Microsoft SQL Server Access with FreeTDS
>>
>> Driver = /usr/lib64/libtdsodbc.so.0
>>
>>
>>
>>
>>
>> -------------
>>
>> freetds.conf
>>
>> -------------
>>
>>
>>
>> # NTS-ENTDBD1\DELTA ==> SQL Server Instance
>>
>> [DELTA]
>>
>>   host = NTS-ENTDBD1
>>
>>   instance = DELTA
>>
>>   tds_version = 7.0
>>
>>
>>
>> # agl-entdbd5 ==> SQL Server Instance
>>
>> # agl-entdbd5 is the listener name that will connect to the primary replica
>>
>> [ENTDBD5]
>>
>>       host = agl-entdbd5
>>
>>       instance = MSSQLSERVER  =è No named instances on agl-entdbd5, using
>> default instance name
>>
>>       tds_version = 7.0
>>
>> #
>>
>>
>>
>>
>>
>> Confidentiality Notice: The information contained in this e-mail and any
>> attachments (including, but not limited to, any attached e-mails) may be
>> legally privileged and confidential. If you are not an intended recipient,
>> you are hereby notified that any dissemination, distribution or copying of
>> this e-mail is strictly prohibited. If you have received this e-mail in
>> error, please notify the sender and permanently delete the e-mail and any
>> attachments immediately. You should not retain, copy or use this e-mail or
>> any attachment for any purpose, nor disclose all or any part of the contents
>> to any other person.
>>
>> _______________________________________________
>> unixODBC-support mailing list
>> [hidden email]
>> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
>>
> _______________________________________________
> unixODBC-support mailing list
> [hidden email]
> http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support
Confidentiality Notice: The information contained in this e-mail and any attachments (including, but not limited to, any attached e-mails) may be legally privileged and confidential. If you are not an intended recipient, you are hereby notified that any dissemination, distribution or copying of this e-mail is strictly prohibited. If you have received this e-mail in error, please notify the sender and permanently delete the e-mail and any attachments immediately. You should not retain, copy or use this e-mail or any attachment for any purpose, nor disclose all or any part of the contents to any other person.
_______________________________________________
unixODBC-support mailing list
[hidden email]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-support