I've been turning google upside down and couldn't find an answer. I can connect to my oracle instance like this:
sqlplus 'myuser@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=msoracle.cnujcn8mkxea.us-east-1.rds.amazonaws.com)(PORT=1521))(CONNECT_DATA=(SID=ORCL)))'
But I can't make it work if I create a TNSNAMES.ORA at /usr/lib/oracle/12.1/client64/network/admin
ORCL=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=msoracle.cnujcn8mkxea.us-east-1.rds.amazonaws.com)(PORT=1521))
)
(CONNECT_DATA=
(SERVICE_NAME=ORCL) -> I tried SID as well. No luck.
)
)
I tried to
export ORACLE_SID=ORCL
export PATH=$PATH:$HOME/bin:/usr/lib/oracle/12.1/client64/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/oracle/12.1/client64/lib
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export TNS_ADMIN=$ORACLE_HOME/network/admin
And nothing. The following message always comes up:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
EDIT: This is the output of the tests in the comments:
[franklin@ip-10-148-17-253 client64]$ sqlplus myuser@ORCL
SQL*Plus: Release 12.1.0.2.0 Production on Fri Aug 5 10:13:39 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name: myuser
Enter password:
ERROR:
ORA-12162: TNS:net service name is incorrectly specified
Enter user-name: ^C