ODBC Connection Problem from Linux to SQL Server Daabase
"Funny,Solomon" <[email protected]> Thu, 10 Mar 2016 19:06:59 +0000
| Newsgroups | gmane.comp.db.unixodbc.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============0922830236==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_6069e1898a6b4a54a409b357e247f6bbntsexchangep2FHLBNYADS_"
--_000_6069e1898a6b4a54a409b357e247f6bbntsexchangep2FHLBNYADS_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Our Unix Admin installed the SQL Server ODBC Drivers for Linux on our Linux=
server, but when I attempt to connect to a SQL Server, I receive the follo=
wing error message:
[IM004][unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_HENV=
failed
[ISQL]ERROR: Could not SQLConnect
I did successfully test the SQL Server authenticated account and password, =
I am trying to connect to within SQL server
When I googled the error, it indicated either the ODBC drivers are not ment=
ioned properly, or environment variable are not set ODBCSYSINI ODBCINI.
I performed the command env from the command line and the environment varia=
bles were set ODBCSYSINI ODBCINI:
ODBCINI=3D/etc/odbc.ini
ODBCSYSINI=3D/etc
I checked the data source and driver configurations set by the Unix Admin, =
and they looked correct:
/etc/odbc.ini
[TITAN]
Description=3DSQL Server ODBC Driver
Driver=3DSQL Server Native Client 11.0
Server=3Dnts-entdbd1
Port=3D1433
Database=3Dprod01
/etc/odbcinst.ini
[SQL Server Native Client 11.0]
Description=3DMicrosoft SQL Server ODBC Driver V1.0 for Linux
Driver=3D/usr/lib64/libodbc.so.1.0.0
Threading=3D1
UsageCount=3D1
Trace=3DYes
This is my companies first experience with Linux ODBC, so we are not sure w=
hat the issue is. I executed a trace for the connect string and found that=
several files/directories could not be found:
/etc/ld.so.preload =3D=3D=3D> Doe=
s not exist
/usr/lib64/tls/x86_64 =3D=3D=3D> No fil=
es in /usr/lib64/tls
/usr/lib64/tls/x86_64/libodbc.so.1 =3D=3D=3D> No files in /usr/li=
b64/tls
/usr/lib64/tls/libodbc.so.1 =3D=3D=3D> No files i=
n /usr/lib64/tls
=
When I execute the find command for file libodbc.so.1, it =
is located in /lib64/tls/libnss_files.so.1 or /lib/libnss_files.so.1
/var/run/nscd/socket =3D=3D=3D> No files=
in /var/run/nscd
/usr/lib64/tls/libnss_files.so.2 =3D=3D=3D> No files in =
/usr/lib64/tls
=
When I execute the find command for file libodbc.so.1, it =
is located in /lib64/tls/libnss_files.so.2 or /lib/libnss_files.so.2
I am not sure how to point the system to these directories, as I have modif=
ied my profile to include them in the PATH, but after re-executing the prof=
ile, the connection test fails.
The following is the output from executing the env command:
_=3D*29835*/bin/env
CVS_RSH=3Dssh
G_BROKEN_FILENAMES=3D1
HISTCONTROL=3Dignoredups
HISTSIZE=3D1000
HOME=3D/home/funnys
HOSTNAME=3Dlx-had12
KRB5CCNAME=3DFILE:/tmp/krb5cc_2072_ocjbfp
LANG=3Den_US.UTF-8
LESSOPEN=3D||/usr/bin/lesspipe.sh %s
LOGNAME=3Dfunnys
MAIL=3D/var/spool/mail/funnys
ODBCINI=3D/etc/odbc.ini
ODBCSYSINI=3D/etc
PATH=3D/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/=
usr/sbin:/sbin:/usr/local/etc:/lib:/lib64
PS1=3Dlx-had12:${LOGNAME}:${PWD}>
PWD=3D/home/funnys
QTDIR=3D/usr/lib64/qt-3.3
QTINC=3D/usr/lib64/qt-3.3/include
QTLIB=3D/usr/lib64/qt-3.3/lib
SELINUX_LEVEL_REQUESTED=3D
SELINUX_ROLE_REQUESTED=3D
SELINUX_USE_CURRENT_RANGE=3D
SHELL=3D/bin/ksh
SHLVL=3D1
SSH_CLIENT=3D10.2.202.206 52940 22
SSH_CONNECTION=3D10.2.202.206 52940 10.2.201.191 22
SSH_TTY=3D/dev/pts/0
TERM=3Dxterm
USER=3Dfunnys
_AST_FEATURES=3DUNIVERSE - ucb
A__z=3D"*SHLVL
Is the environment missing any variables?
Any assistance anyone rendered will be greatly appreciated!
Thank You
Solomon Funny
Database Services
Federal Home Loan Bank of New York
30 Montgomery Street
Jersey City, NJ 07322
(201) 356-1235
[email protected]
Confidentiality Notice: The information contained in this e-mail and any at=
tachments (including, but not limited to, any attached e-mails) may be lega=
lly 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 attachme=
nts immediately. You should not retain, copy or use this e-mail or any atta=
chment for any purpose, nor disclose all or any part of the contents to any=
other person.
--_000_6069e1898a6b4a54a409b357e247f6bbntsexchangep2FHLBNYADS_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dus-ascii"=
>
<meta name=3D"Generator" content=3D"Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"purple">
<div class=3D"WordSection1">
<p class=3D"MsoNormal">Our Unix Admin installed the SQL Server ODBC Drivers=
for Linux on our Linux server, but when I attempt to connect to a SQL Serv=
er, I receive the following error message:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><b>[IM004][unixODBC][Driver Manager]Driver's SQLAllo=
cHandle on SQL_HANDLE_HENV failed<o:p></o:p></b></p>
<p class=3D"MsoNormal"><b>[ISQL]ERROR: Could not SQLConnect <o:p></o:p></b>=
</p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I did successfully test the SQL Server authenticated=
account and password, I am trying to connect to within SQL server<o:p></o:=
p></p>
<p class=3D"MsoNormal" style=3D"line-height:13.85pt;background:white">When =
I googled the error, it indicated either the ODBC drivers
<span style=3D"font-size:10.0pt;font-family:"Arial","sans-se=
rif";color:#222222">are not mentioned properly, or environment variabl=
e are not set ODBCSYSINI ODBCINI.<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"line-height:13.85pt;background:white"><span=
style=3D"font-size:10.0pt;font-family:"Arial","sans-serif&q=
uot;;color:#222222"><o:p> </o:p></span></p>
<p class=3D"MsoNormal" style=3D"line-height:13.85pt;background:white"><span=
style=3D"font-size:10.0pt;font-family:"Arial","sans-serif&q=
uot;;color:#222222">I performed the command env from the command line and t=
he environment variables were set ODBCSYSINI ODBCINI:<o:p></o:p></span></p>
<p class=3D"MsoNormal" style=3D"line-height:13.85pt;background:white"><span=
style=3D"font-size:10.0pt;font-family:"Arial","sans-serif&q=
uot;;color:#222222"><o:p> </o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222">ODBCINI=3D/etc/odbc.ini<o:p=
></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222">ODBCSYSINI=3D/etc<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222"><o:p> </o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222">I checked the data source a=
nd driver configurations set by the Unix Admin, and they looked correct:<o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222"><o:p> </o:p></span></p=
>
<p class=3D"MsoNormal"><span style=3D"font-size:10.0pt;font-family:"Ar=
ial","sans-serif";color:#222222">/etc/odbc.ini<o:p></o:p></s=
pan></p>
<p class=3D"MsoNormal">[TITAN]<o:p></o:p></p>
<p class=3D"MsoNormal">Description=3DSQL Server ODBC Driver<o:p></o:p></p>
<p class=3D"MsoNormal">Driver=3DSQL Server Native Client 11.0<o:p></o:p></p=
>
<p class=3D"MsoNormal">Server=3Dnts-entdbd1<o:p></o:p></p>
<p class=3D"MsoNormal">Port=3D1433<o:p></o:p></p>
<p class=3D"MsoNormal">Database=3Dprod01<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">/etc/odbcinst.ini<o:p></o:p></p>
<p class=3D"MsoNormal">[SQL Server Native Client 11.0]<o:p></o:p></p>
<p class=3D"MsoNormal">Description=3DMicrosoft SQL Server ODBC Driver V1.0 =
for Linux<o:p></o:p></p>
<p class=3D"MsoNormal">Driver=3D/usr/lib64/libodbc.so.1.0.0<o:p></o:p></p>
<p class=3D"MsoNormal">Threading=3D1<o:p></o:p></p>
<p class=3D"MsoNormal">UsageCount=3D1<o:p></o:p></p>
<p class=3D"MsoNormal">Trace=3DYes<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">This is my companies first experience with Linux ODB=
C, so we are not sure what the issue is. I executed a trace for the c=
onnect string and found that several files/directories could not be found:<=
o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">/etc/ld.so.preload &nbs=
p; &=
nbsp; &nbs=
p; =3D=3D=
=3D> Does not exist<o:p></o:p></p>
<p class=3D"MsoNormal">/usr/lib64/tls/x86_64 &=
nbsp; &nbs=
p; &=
nbsp; =3D=3D=3D> No files in /usr/lib64/tl=
s<o:p></o:p></p>
<p class=3D"MsoNormal">/usr/lib64/tls/x86_64/libodbc.so.1 =
=3D=3D=3D> No files in /usr/l=
ib64/tls<o:p></o:p></p>
<p class=3D"MsoNormal">/usr/lib64/tls/libodbc.so.1 &=
nbsp; &nbs=
p; =3D=3D=3D> No f=
iles in /usr/lib64/tls<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"> &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nb=
sp; When I execute the find command for=
file libodbc.so.1, it is located in
<b>/lib64/tls/libnss_files.so.1</b> or <b>/lib/libnss_files.so.1</b>&=
nbsp; <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">/var/run/nscd/socket &n=
bsp;  =
; &n=
bsp; =3D=3D=3D> No files in /var/run/nscd<o:p></=
o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">/usr/lib64/tls/libnss_files.so.2 &=
nbsp; &nbs=
p; =3D=3D=3D> No files in /usr/lib64/tls
<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"> &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nb=
sp; When I execute the find command for=
file libodbc.so.1, it is located in
<b>/lib64/tls/libnss_files.so.2</b> or <b>/lib/libnss_files.so.2</b>&=
nbsp; <o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">I am not sure how to point the system to these direc=
tories, as I have modified my profile to include them in the PATH, but afte=
r re-executing the profile, the connection test fails.<o:p></o:p></p>
<p class=3D"MsoNormal"> &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p; &=
nbsp; &nbs=
p;
<o:p></o:p></p>
<p class=3D"MsoNormal">The following is the output from executing the env c=
ommand:<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">_=3D*29835*/bin/env<o:p></o:p></p>
<p class=3D"MsoNormal">CVS_RSH=3Dssh<o:p></o:p></p>
<p class=3D"MsoNormal">G_BROKEN_FILENAMES=3D1<o:p></o:p></p>
<p class=3D"MsoNormal">HISTCONTROL=3Dignoredups<o:p></o:p></p>
<p class=3D"MsoNormal">HISTSIZE=3D1000<o:p></o:p></p>
<p class=3D"MsoNormal">HOME=3D/home/funnys<o:p></o:p></p>
<p class=3D"MsoNormal">HOSTNAME=3Dlx-had12<o:p></o:p></p>
<p class=3D"MsoNormal">KRB5CCNAME=3DFILE:/tmp/krb5cc_2072_ocjbfp<o:p></o:p>=
</p>
<p class=3D"MsoNormal">LANG=3Den_US.UTF-8<o:p></o:p></p>
<p class=3D"MsoNormal">LESSOPEN=3D||/usr/bin/lesspipe.sh %s<o:p></o:p></p>
<p class=3D"MsoNormal">LOGNAME=3Dfunnys<o:p></o:p></p>
<p class=3D"MsoNormal">MAIL=3D/var/spool/mail/funnys<o:p></o:p></p>
<p class=3D"MsoNormal"><b><span style=3D"color:red">ODBCINI=3D/etc/odbc.ini=
<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:red">ODBCSYSINI=3D/etc<o:p><=
/o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:red">PATH=3D/usr/lib64/qt-3.=
3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/loc=
al/etc:/lib:/lib64<o:p></o:p></span></b></p>
<p class=3D"MsoNormal">PS1=3Dlx-had12:${LOGNAME}:${PWD}><o:p></o:p></p>
<p class=3D"MsoNormal">PWD=3D/home/funnys<o:p></o:p></p>
<p class=3D"MsoNormal">QTDIR=3D/usr/lib64/qt-3.3<o:p></o:p></p>
<p class=3D"MsoNormal">QTINC=3D/usr/lib64/qt-3.3/include<o:p></o:p></p>
<p class=3D"MsoNormal">QTLIB=3D/usr/lib64/qt-3.3/lib<o:p></o:p></p>
<p class=3D"MsoNormal">SELINUX_LEVEL_REQUESTED=3D<o:p></o:p></p>
<p class=3D"MsoNormal">SELINUX_ROLE_REQUESTED=3D<o:p></o:p></p>
<p class=3D"MsoNormal">SELINUX_USE_CURRENT_RANGE=3D<o:p></o:p></p>
<p class=3D"MsoNormal">SHELL=3D/bin/ksh<o:p></o:p></p>
<p class=3D"MsoNormal">SHLVL=3D1<o:p></o:p></p>
<p class=3D"MsoNormal">SSH_CLIENT=3D10.2.202.206 52940 22<o:p></o:p></p>
<p class=3D"MsoNormal">SSH_CONNECTION=3D10.2.202.206 52940 10.2.201.191 22<=
o:p></o:p></p>
<p class=3D"MsoNormal">SSH_TTY=3D/dev/pts/0<o:p></o:p></p>
<p class=3D"MsoNormal">TERM=3Dxterm<o:p></o:p></p>
<p class=3D"MsoNormal">USER=3Dfunnys<o:p></o:p></p>
<p class=3D"MsoNormal">_AST_FEATURES=3DUNIVERSE - ucb<o:p></o:p></p>
<p class=3D"MsoNormal">A__z=3D"*SHLVL<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><b>Is the environment missing any variables?<o:p></o=
:p></b></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Any assistance anyone rendered will be greatly appre=
ciated!<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Thank You<o:p></o:p></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">Solomon Funny<o:p><=
/o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">Database Services<o=
:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">Federal Home Loan B=
ank of New York<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">30 Montgomery Stree=
t<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">Jersey City, NJ 073=
22<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">(201) 356-1235<o:p>=
</o:p></span></b></p>
<p class=3D"MsoNormal"><b><span style=3D"color:#1F497D">solomon.funny@fhlbn=
y.com<o:p></o:p></span></b></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
</div>
Confidentiality Notice: The information contained in this e-mail and any at=
tachments (including, but not limited to, any attached e-mails) may be lega=
lly 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 de=
lete the e-mail and any attachments immediately. You should not retain, cop=
y or use this e-mail or any attachment
for any purpose, nor disclose all or any part of the contents to any other=
person.
</body>
</html>
--_000_6069e1898a6b4a54a409b357e247f6bbntsexchangep2FHLBNYADS_--
--===============0922830236==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
--===============0922830236==--