Solved

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

Posted on 2014-11-20
7
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 77

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
What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

 
LVL 77

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 77

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
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.
Suggested Courses

626 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