Solved

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

Posted on 2014-11-20
7
358 Views
Last Modified: 2014-11-20
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.
0
Comment
Question by:jl66
  • 3
  • 2
  • 2
7 Comments
 
LVL 76

Accepted Solution

by:
slightwv (䄆 Netminder) earned 450 total points
ID: 40455149
It works for me:
C:\Documents and Settings>tnsping fred

TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 20-NOV-2
014 10:04:48

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
C:\oracle\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

TNS-03505: Failed to resolve name

C:\Documents and Settings>set TNS_ADMIN=c:\

C:\Documents and Settings>tnsping fred

TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 20-NOV-2
014 10:04:59

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
c:\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 111.111.
111.111)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORCL)
))
OK (40 msec)

C:\Documents and Settings>

Open in new window


What version are you using?
Check the permissions on the files.
0
 
LVL 23

Assisted Solution

by:David
David earned 50 total points
ID: 40455153
Set TNSADMIN as a system environment variable.
0
 
LVL 23

Expert Comment

by:David
ID: 40455161
Control panel | system | advanced system settings | environment variables
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40455162
>>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.
0
 

Author Comment

by:jl66
ID: 40455487
Thanks a lot for the tip.
0
 

Author Closing Comment

by:jl66
ID: 40455491
Thanks a lot
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 40455506
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now