Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Another myth goes by the wayside

Another myth goes by the wayside

From: Bowes, Chris <Chris.Bowes_at_kosa.com>
Date: Fri, 13 Dec 2002 08:48:35 -0800
Message-ID: <F001.00519449.20021213084835@fatcity.com>


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

--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Bowes, Chris
  INET: Chris.Bowes_at_kosa.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services

---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Fri Dec 13 2002 - 10:48:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US