I need to setup Oracle ODBC drivers on RHEL 6 to connect to an Oracle data source residing on a remote Windows machine.
I have taken the following steps:
[1] Installed oracle-instanceclient-basic
[2] Set environment variables: ORACLE_HOME and LD path
[3] Created /etc/oracle/TNSnames.ora and configured but it did not set it correctly
Initially, I got the error, "Connect failed because target or object does not exist"
Then, I set: ORACLE_SID = DB_NAME
in the TNSnames.ora file.
But, that did not fix the issue, I got a new error message now: "TNS: net service name is incorrectly specified"
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:To chech for the name of listener, type the following commands on the windows prompt that is running the Oracle server:
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
export TNS_ADMIN=/etc/oracle
vi /etc/odbcinst.ini
vi /etc/odbc.ini
isql -v simple
I think that we should assign the version of unixODBC. if to connect the oracle12c, we should use the unixODBC-2.3.1