I have installed the Oracle instantclient11.2-basic and instantclient11.2-sqlplus packages on a remote machine and of course want to connect to a remote oracle host where my Oracle 11.2 database is installed.
So ...
sqlplus is located at /usr/lib/oracle/11.2/client64/bin
And the necessary libaries at /usr/lib/oracle/11.2/client64/libs
I can connect with sqlplus providing all the parameters. So like this:
sqlplus <username>/<username>@"(DESCRIPTION =(ADDRESS= (PROTOCOL = TCP)(HOST=<DB_HOST-IP>)(PORT = 1521))(CONNECT_DATA=(SID = <SERVICE_ID>)))"
No problem!
BUT ...
If I try to just connect with sqlplus I get a "ORA-12545: Connect failed because target host or object does not exist"
The above tells me that sqlplus on the client is not finding the tnsnames.ora file I placed on the client
I understand ORACLE_HOME on the client is /usr/lib/oracle/11.2/client64/libs (detailed by the documentation)
And I created the sub-directory /network/admin beneath ORACLE_HOME on the client for my .ora network configuration files.
I have placed a tnsnames.ora, listener.ora and sqlnet.ora at this /usr/lib/oracle/11.2/client64/libs/network/admin location
These files are very simple and all good in terms of SID and server/IP settings:
Their content looks like this:
listener.ora: LISTENER = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.226.81.215)(PORT = 1521))
sqlnet.ora: names.directory_path = (TNSNAMES, ONAMES, HOSTNAME)
tnsnames.ora:
<SERVICE_ID> =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <DB_HOST-IP>)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = <SERVICE_ID>)
)
)
That's it.
I have checked ALL the standard things:
- A ping to the remote oracle host works.
- I cannot tnsping because no tnsping is present in the instantclient11-basic ... but the network clearly works
- Listener is started on the remote host
- The hostname IS good in the
And ...
I have created variables on my remoted client
ORACLE_HOME=/usr/lib/oracle/11.2/client64/libs
ORACLE_SID=<SERVICE_ID>
... and also tried
TNS_ADMIN=/usr/lib/oracle/11.2/client64/libs (although this should not be necessary according to the documentation as this is the default!)
BUT... when I attempt to connect with sqlplus on the client I get the "ORA-12545: Connect failed because target host or object does not exist"
As stated above .... it seems to me my .ora config files are not being discovered by the sqlplus program in my basic client
Why is this ?
CAN IT BE SO DIFFICULT!
I have been though literally hundreds of pages with multiple variations of configuration options ...
And tried many of them.
Could someone please point me to what is actually required for the instantclient11 -basic and -sqlplus local configs so that I can connect with a straight "sqlplus" without supplying all the parameters ?