How do I setup Oracle ODBC drivers on RHEL 6/Linux How do I setup Oracle ODBC drivers on RHEL 6/Linux oracle oracle

How do I setup Oracle ODBC drivers on RHEL 6/Linux


yum install unixODBCrpm -ivh oracle-instantclient-basic-10.2.0.3-1.i386.rpm #downloaded on http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.htmlunzip instantclient-odbc-linux32-10.2.0.3-20061115.zip #downloaded on http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.htmlcp ./instantclient_10_2/libsqora.so.10.1 /usr/lib/oracle/10.2.0.3/client/lib/export ORACLE_HOME=/usr/lib/oracle/10.2.0.3/clientexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

Also you need to set $TWO_TASK (default location where Oracle is looking to pickup the server) to point to where the Oracle server is running on Windows - - don't forget to add the listener at the end after the port number:

export TWO_TASK=//213.123.23.19:1521/listener

To chech for the name of listener, type the following commands on the windows prompt that is running the Oracle server:

lsnrctlstatus

It will enlist listeners and their state (READY or UNKNOWN). Connect to the listener that is in the ready state: Instance "zelistener", status READY

mkdir /etc/oracle

vi /etc/oracle/tnsnames.ora

MY_SID = ( DESCRIPTION =  (ADDRESS_LIST =  (ADDRESS =  (PROTOCOL = TCP)  (Host = 127.0.0.1)  (Port = 1521)  ) ) (CONNECT_DATA = (SID = MY_SID) ))

export TNS_ADMIN=/etc/oracle

vi /etc/odbcinst.ini

[OracleODBC-10g]Description = Oracle ODBC driver for Oracle 10gDriver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1FileUsage = 1Driver Logging = 7

vi /etc/odbc.ini

[simple]Driver = OracleODBC-10gDSN = OracleODBC-10gServerName = MY_SIDUserID = USERPassword = PASSWORD

isql -v simple

+---------------------------------------+| Connected!                            ||                                       || sql-statement                         || help [tablename]                      || quit                                  ||                                       |+---------------------------------------+


I think that we should assign the version of unixODBC.if to connect the oracle12c, we should use the unixODBC-2.3.1