How do I setup Oracle ODBC drivers on RHEL 6/Linux
yum install unixODBC
rpm -ivh oracle-instantclient-basic-10.2.0.3-1.i386.rpm #downloaded on http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
unzip instantclient-odbc-linux32-10.2.0.3-20061115.zip #downloaded on http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/linuxsoft.html
cp ./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/client
export 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:
lsnrctl
status
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 10g
Driver = /usr/lib/oracle/10.2.0.3/client/lib/libsqora.so.10.1
FileUsage = 1
Driver Logging = 7
vi /etc/odbc.ini
[simple]
Driver = OracleODBC-10g
DSN = OracleODBC-10g
ServerName = MY_SID
UserID = USER
Password = PASSWORD
isql -v simple
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
Connecting Oracle using unixODBC: Can't open lib '/usr/lib/oracle/12.1/client/lib/libsqora.so.12.1'
The solution was to install also basic packages from http://www.oracle.com/technetwork/topics/linuxsoft-082809.html . I had only installed ODBC packages.
Install ODBC driver in Alpine Linux Docker Container
I was facing the same issue. I solved this issue by adding RUN apk update
before RUN apk add
commands.(I was using python:3.6-alpine)
Dockerfile
FROM python:3.6-alpine
RUN apk update
RUN apk add gcc libc-dev g++ libffi-dev libxml2 unixodbc-dev mariadb-dev postgresql-dev
Related Topics
The Return Code from 'Grep' Is Not as Expected on Linux
Define Alias That References Other Aliases
Changing Permissions of Files in a Directory Recursively
Allocate Writable Memory in the .Text Section
Using Rsync Include and Exclude Options to Include Directory and File by Pattern
Git: Can't Push (Unpacker Error) Related to Permission Issues
Postgresql -Bash: Psql: Command Not Found
How to Delete the First Column ( Which Is in Fact Row Names) from a Data File in Linux
How to Add Deploy Key for 2 Repo with 1 User on Github
Centos Error - Sudo: Effective Uid Is Not 0, Is Sudo Installed Setuid Root
Extract Tar the Tar.Bz2 File Error
Identify Other End of a Unix Domain Socket Connection
Creating a System Call in Linux
Differencebetween './Example.Sh' and 'Sh Example.Sh'
Can You Prevent a Command from Going into the Bash Shell Command History
How to Set a Static Ip Address in a Docker Container