This post will show you the order in which SQL*Plus for Solaris reads the configuration files like the tnsnames.ora.
tnsnames.ora
- $HOME/.tnsnames.ora
- $TNS_ADMIN/tnsnames.ora
- /var/opt/oracle/tnsnames.ora
- $ORACLE_HOME/network/admin/tnsnames.ora
If the specified alias is not found in (or the file does not exists) in $HOME/.tnsnames.ora it will try to find the alias in the next available file using the above order. If such a file exists, but the alias is not available there you’ll receive an error message. So SQL*Plus only reads the next file when .tnsnames.ora is available and the alias cannot be found there.