Title: Another myth goes by the wayside
Chris,
 
yeup.  oldie but goodie - works that way all the way back to version 6.2 on VAX VMS.
 

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
From: Bowes, Chris [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 11:49 AM
To: Multiple recipients of list ORACLE-L
Subject: Another myth goes by the wayside

I learned something new today.  We were getting an error when our VB app was connecting to the base:  "ORA-12505 TNS: listener could not resolve SID given in connect descriptor".  It was an obvious tnsnames problem.  So we punch up the c:\orant\network\admin\tnsnames.ora and we find some problems.  We fix them and try again.  No go.  Program still blows on the ORA-12505.  I punch up a command prompt and do a tnsping.  It works.  So programs do not work, but the tnsping does.  Hmmmm.  Do a search on the computer registry.  No entries for TNS_ADMIN.  Do a search for TNSNAMES.ORA on the computer.  No other files found other than the one we're looking at.  We rename the c:\orant\network\admin\tnsnames.ora to kill it.  Still get the same error message.   Finally, my coworker notices that there is a TNSNAMES.ORA on a mapped network drive that she uses to copy to users PC's.  This tnsnames file happens to be located in the working directory as specified by the icon that runs the program.    We punch it up and fix it.  Program works.

So what we learned is that the working directory of the icon becomes the first search point for SQLNET!   Not ORACLE_HOME/network/admin.  Not anything in the path.  No, the first search is the icon's working directory.

These PC's were sqlnet 2.3.4  as clients, but I have tested it on my 8i clients and it does it there too.  This happens whether or not the TNS_ADMIN value is set in the registry or environment variables. 

After carefully searching metal link, I found paper 114085.1 and it does have a reference to it.  It says Oracle 9i, but it is the same for 7 and 8.  Here's a clip:
Windows NT/2000 running Oracle 9i
First: The directory where the application is launched. For example, if sqlplus resides in
ORACLE_HOME\bin\sqlplus but was launched from the c:\temp directory, then
c:\temp is searched for a tnsnames.ora file.
Second: The value of the TNS_ADMIN environment variable.
Third: ORACLE_HOME\network\admin

So if you really want to have some fun (hey, April fools day is just around the corner), slip a rogue tnsnames file out there on your fellow DBA's and see if he finds it...   Cheers!

--Chris

Reply via email to