Where does SQL*Plus look for configuation files on Solaris

This post will show you the order in which SQL*Plus for Solaris reads the configuration files like the tnsnames.ora.

tnsnames.ora

  1. $HOME/.tnsnames.ora
  2. $TNS_ADMIN/tnsnames.ora
  3. /var/opt/oracle/tnsnames.ora
  4. $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.