Link to home
Start Free TrialLog in
Avatar of jl66
jl66Flag for United States of America

asked on

How to change the location of tns_admin in Oracle 11gr2?

In DOS prompt, I setup TNS_ADMIN (For example, set TNS_ADMIN=D:\ ) to point to a location, saying D:\ since I have the customized tnsnames.ora and sqlnet.ora files there. However when I tnsping dbname in the same DOS window, it shows that sqlnet.ora still uses the default one: $ORACLE_HOME/network/admin. Is there anyway to let tnsping use the customized one in D:\ ? I greatly appreciate it if any gurus can shed some light on it.
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Control panel | system | advanced system settings | environment variables
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>Set TNSADMIN as a system environment variable.

It can be a local variable for testing as shown above.

Granted, it should be a system variable once you get everything set up the way you want it.
Avatar of jl66

ASKER

Thanks a lot for the tip.
Avatar of jl66

ASKER

Thanks a lot
Doing a little more experimenting:
It looks like tnsping looks in the current folder first.  So if you were sitting in $ORACLE_HOME/network/admin when you ran it, it will use the one found in there and ignore the TNS_ADMIN variable.