Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tns_admin configuration

Status
Not open for further replies.

coastie

Technical User
Mar 20, 2002
6
US
I am running Oracle 8.1.7 on a Solaris 2.8 server. How do I prevent TNS_ADMIN from being set when I start the listener? The tnsnames.ora file is periodically overwritten and users need to use create database links to other databases using their own tnsnames.ora.

If I place the entries in the tnsnames.ora file it is lost when the file is overwritten. and with TNS_ADMIN set they can't get to their own tnsnames.ora file.
 
Some questions:
Are your clients using Windows workstations or are they on the server?

Why/how is your tnsnames.ora file being overwritten on the server?

Starting the listener does not set TNS_ADMIN.

TNS_ADMIN on the server defaults to nothing. The default location for tnsnames.ora is $ORACLE_HOME/network/admin and unless you set $TNS_ADMIN, ORACLE looks there. Check your UNIX profile/login file to see if it's being set.
On the client, TNS_ADMIN might be an environment variable or it could be in the registry
 
Hi,
Furthermore, Database links use the tnsnames.ora on the SERVER not the workstation - because a database link is a server-to-server connection. The users tnsnames.ora file is not used at all with these links.

Nothing in Oracle causes tnsnames.ora or ( if set ) the environment variable $TNS_ADMIN to be changed unless your scripts do it ...

[profile]

 
Additionally -

TNS_ADMIN is a registry key that is located under
HKEY_LOCAL_MACHINE
--Software
--Oracle
--HOME0 (that's a zero).

This entry is an absolute path that points to a copy of
a tnsnames.ora file. This makes for editing 1 file instead of having to change all the client copies.

You can use regedt32(carefully) to take a look and see where your clients are being pointed to.

This is something that is set via login script on our network.


In the UNIX(HP-UX 11.0) world... we put a copy of the tnsnames.ora in the /etc directory on each database server
and since it is in the default search order, it picks it up, and again we're only maintaining the minimum number of copies.

As the others have mentioned though.....if something is overwriting your file - that's a problem. Otherwise, maybe you're maintaining the wrong file....

helpfull I hope,
-Maxx
 
Hi,
The TNS_ADMIN does not have to be in
HKEY_LOCAL_MACHINE
--Software
--Oracle
--HOME0 (that's a zero).

in fact. if you have a multi-home setup, this would only work for that home..

Set it in
HKEY_LOCAL_MACHINE
--Software
--Oracle
and it will be used by ALL homes...

just my 2c
[profile]

 
Thank you all for the quick responses. I found that the variable was being incorrectly set in my profile. Once that was corrected all is well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top