unixODBC connection
704685Jun 2 2009 — edited Jun 2 2009Hi there,
Since a couple of weeks i tried to set an Oracle connection through unixODBC, in a CentOS 52 machine, but i've failed miserably.
I've got installed from sources unixODBC 2.2.14 (with no GUI enabled), Oracle instantclient (10.2.0.4_1) basic, instantclient odbc and instantclient sqlplus. I established a connection to an Oracle remote server, successfully. The issues come when i dream about doing it using unixODBC...
I created the file tnsnames.ora in the folder $ORACLE_HOME/network/admin, and it looks like this:
ASTERPRU =
(DESCRIPTION =
(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)
(Host = 10.133.3.43)
(Port = 1522)))
(CONNECT_DATA =(SID = ASTERPRU)(SERVER = DEDICATED)))
Question: Do i really need the tnsnames.ora file ??... does oracle instantclient need it in order to establish connections ??... i mean, using just the sqlplus and the connection string was enough...
My odbcinst.ini looks like this:
[Oracle 10g ODBC driver]
Description = Oracle ODBC driver for Oracle 10g
Driver = $ORACLE_HOME/libsqora.so.10.1
Setup =
FileUsage =
CPTimeout =
CPReuse =
My odbc.ini looks like this:
[oradsn]
Description = Oracle connection to asterpru database
Driver = ORACLE
Database = //10.133.3.43:1522/ASTERPRU
User = ANAP
Password = ANAPPRU
Port = 1522
DSN = ASTERPRU
SERVER_NAME = ASTERPRU
METADATA_ID = 0
ENABLE_USER_CATALOG = 1
ENABLE_SYNONYMS = 1
And my environment variables are like this:
export ORACLE_HOME=/opt/EPMBOGOTA/oracle/instantclient_10_2
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORACLE_SID=ASTERPRU
export SQLPATH=$ORACLE_HOME
Unfortunately when i execute the unixODBC isql tool, for testing the connection i get:
[root@centos52 bin]# isql -v oradsn
[S1000][unixODBC][Oracle][ODBC][Ora]ORA-12545: Connect failed because target host or object does not exist
[ISQL]ERROR: Could not SQLConnect
Sniff... can somebody help me ???...
Note: I have made MySQL connections through unixODBC successfully, so i'm 100% sure that unixODBC is not the problem