Solved

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

Posted on 2014-11-20
7
362 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You may have a outside contractor who comes in once a week or seasonal to do some work in your office but you only want to give him access to the programs and files he needs and keep privet all other documents and programs, can you do this on a loca…
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This Micro Tutorial will give you basic overview of the control panel section on Windows 7. It will depth in Network and Internet, Hardware and Sound, etc. This will be demonstrated using Windows 7 operating system.

920 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