This discussion is archived
0 Replies Latest reply: Jan 17, 2013 3:22 AM by 761281 RSS

Problem of Connecting to MSSQL from Oracle with ODBC

761281 Newbie
Currently Being Moderated
Hi All,
I have ORacle 10.2.0.5 on SLES10 64Bit. And I want to connect mssql server on internet using oracle dblink. To do this, I installed freetds (intalled path is /usr/local/freetds/) and I configure setting like below. I tried to connect using isql (isq ZAFER 'userName' 'password') and I can select count from table. But When I want to select from mssql table with oracle dblink on oracle, I have this error :
+/usr/local/freetds/lib/libtdsodbc.so: wrong ELF class: ELFCLASS64+
Could not find symbol 'SQLAllocConnect' in dynamic library"
Failed to load dynamic library '/usr/local/freetds/lib/libtdsodbc.so'

my /etc/unixODBC/odbc.ini file
+[ZAFER]+
Driver = TDS
Description = Microsoft SQL Server
Server = 10.0.34.47
Database = SQLDBNAME
Port = 1433
TDS_Version = 8.0

+[Default]+
Driver = TDS

my /etc/unixODBC/odbcinst.ini file
+[TDS]+
Description = FreeTDS v.84 Driver
Driver = /usr/local/freetds/lib/libtdsodbc.so
Trace = Yes
TraceFile = /tmp/freetds.log
FileUsage = 1

my tnsnames.ora file
ZAFER.WORLD =
+(DESCRIPTION =+
+(ADDRESS_LIST =+
+(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))+
+)+
+(CONNECT_DATA =+
+(SID = ZAFER)+
+)+
+(HS=OK)+
+)+

my listener.ora file
SID_LIST_LSNR_DEV =
+(SID_LIST =+
+(SID_DESC=+
+(SID_NAME=ZAFER)+
+(ORACLE_HOME = /opt/oracle/product/10.2/db_1)+
+(PROGRAM=hsodbc)+
+(ENVS = "LD_LIBRARY_PATH=/opt/oracle/product/10.2/db_1/lib32:/usr/local/freetds/lib:/opt/oracle/product/10.2/db_1/hs/lib")+
+)+
+)+

LSNR_DEV =
+(DESCRIPTION =+
+(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1522))+
+)+

my initZAFER.ora file
HS_FDS_CONNECT_INFO = ZAFER
HS_FDS_TRACE_LEVEL = DEBUG
HS_FDS_TRACE_FILE_NAME = /opt/oracle/product/10.2/db_1/hs/admin/ilke.trc
HS_FDS_SHAREABLE_NAME = /usr/local/freetds/lib/libtdsodbc.so
set ODBCINI=/etc/unixODBC/odbc.ini
set ODBCINSTINI=/etc/unixODBC/odbcinst.ini

my ilke.trc trace file
Oracle Corporation --- THURSDAY  JAN 17 2013 12:02:58.788

Version 10.2.0.5.0

hoagprd (2): ; hoagprd Entered.
+HOACONN.C (270): ; [Generic Connectivity Using ODBC] version: 10.2.0.0.0080+
HOACONN.C (323): ; Class version: 300
hoagprd (2): ; hoagprd Exited with retcode = 0.
hoainit (3): ; hoainit Entered.
+(0): ; connect string is: defTdpName=ZAFER;SYNTAX=(ORACLE8_HOA, BASED_ON=ORACLE8, IDENTIFIER_QUOTE_CHAR="", CASE_SENSITIVE=CASE_SENSITIVE_QUOTE);BINDING=<navobj><binding><datasources><datasource name='ZAFER' type='GENERIC_ODBC_FOR_HS' connect='ZAFER'><driverProperties/></datasource></datasources><remoteMachines/><environment><optimizer noFlattener='true'/><misc year2000Policy='-1' consumerApi='1' codepage='WE8ISO8859P15' sessionBehavior='4'/><queryProcessor parserDepth='2000' tokenSize='1000' noInsertParameterization='true'+
noThreadedReadAhead='true' noCommandReuse='true'/><debug generalTrace='true'/></environment></binding></navobj>
ORACLE GENERIC GATEWAY Log File Started at 2013-01-17T12:02:58

hoainit (3): ; hoainit Exited with retcode = 0.
hoalgon (7): ; hoalgon Entered. name = DISCOS.
sysbase.c (672): ; /usr/local/freetds/lib/libtdsodbc.so: wrong ELF class: ELFCLASS64
+DB_ODBC_INTERFACE (718): ; [C077] Could not find symbol 'SQLAllocConnect' in dynamic library+
+DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library '/usr/local/freetds/lib/libtdsodbc.so'+
+DB_ODBC_INTERFACE (727): ; [C077] Could not find symbol 'SQLAllocConnect' in dynamic library+
+DRV_InitTdp: DB_ODBC_INTERFACE (718): ; [C077] Could not find symbol 'SQLAllocConnect' in dynamic library+
+DB_ODBC_INTERFACE (722): ; [C079] Failed to load dynamic library '/usr/local/freetds/lib/libtdsodbc.so'+
nvRETURN (./drv_bind.c 231): -2220
nvRETURN (./nav_bind.c 298): -2220
hoalgon (7): ; hoalgon Exited with retcode = 28500.
hoaexit (6): ; hoaexit Entered.
hoaexit (6): ; hoaexit Exited with retcode = 0.
+(0): ; Closing log file at THU JAN 17 12:02:58 2013.+

Edited by: ilke_altinpulluk on 17.Oca.2013 03:19

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points