Where does sqlnet.ora live

  • From: "Goulet, Richard" <Richard.Goulet@xxxxxxxxxxx>
  • To: "oracle-l" <oracle-l@xxxxxxxxxxxxx>
  • Date: Thu, 17 Sep 2009 10:31:03 -0400

This is a post for a friend who at the moment does not have posting
privileges.  Steve could I kindly ask you to check on that fact for me??
Thanks.

Dick Goulet
Senior Oracle DBA/NA Team Lead
PAREXEL International
900 Chelmsford St, Suite 310
Lowell, MA 01821
978.614.2857
Richard.Goulet@xxxxxxxxxxx

SUBJECT: Default Search Hiearchy for Oracle
EMAIL ADDRESS: george.rusnak.ctr@xxxxxxxx


Please, I need some help/clarification.

What is the default search hierarchy for Oracle to locate the sqlnet.ora
file and the tnsnames.ora file(s)?
I found an Oracle doc that stated:

By default, Oracle Net configuration files are sought and resolved from
the following locations:

  1 TNS_ADMIN environment variable (incl. Windows Registry Key)
  2 /etc or /var/opt/oracle (Unix)
  3 $ORACLE_HOME/network/admin (Unix)
  4 %ORACLE_HOME%/Network/Admin or %ORACLE_HOME%/Net80/Admin (Windows) 

I ran:
truss tnsping 'sqlplus opsdba/xxxxxxxx@pcrpi' 2>&1 | grep sqlnet.ora
access("/opt/oracle/product/10.2.A/network/admin/sqlnet.ora", F_OK)
ERR#2 ENOENT
access("/opt/oracle/product/10.2.A/network/admin/sqlnet.ora", F_OK)
ERR#2 ENOENT

I do not have an sqlnet.ora file at this location, so the error message
is correct but I do have a sqlnet.ora in /etc yet it did not find it.

ls -lai /etc/sqlnet.ora
   -rw-r--r--   1 oracle     dba           1049 Sep 10  2008
/etc/sqlnet.ora

Next test:
truss tnsping 'sqlplus opsdba/xxxxxxx@pcrpi' 2>&1 | grep tnsnames.ora
access("/home/rusnakga/.tnsnames.ora", F_OK)
ERR#2 ENOENT
access("/etc/tnsnames.ora", F_OK)
= 0
stat("/etc/tnsnames.ora", 0x800003fffb0f4de0)
= 0
open("/etc/tnsnames.ora", O_RDONLY|O_LARGEFILE, 0666)
= 3

I do not have a .tnsnames.ora in my home directory so, I can understand
that error and it continued its search.
I do not have a tnsnames.ora in $ORACLE_HOME but no indication Oracle
looked there. 
I do have a tnsnames.ora in /etc and it found it.

TNS_ADMIN was not set.

So, what is the search order for sqlnet.ora and tnsnames.ora?? How can I
verify the search it goes through?

The server is: HP-UX XXXXXXXXX B.11.11 U 9000/800 
      Oracle:   10.2.0.4.0


TIA,

Al Rusnak
Database Administrator
ManTech International Corporation
Fort Lee, Virginia
Phone: 804.734.8000  ex. 48210
Email: george.rusnak.ctr@xxxxxxxx


The information transmitted in this communication is intended only for
the person or entity to which it is addressed and may contain
confidential and/or privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance upon,
this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please destroy
any copies, contact the sender and delete the material from any
computer.


Other related posts: