Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-11-20
7
Medium Priority
?
402 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 1800 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 200 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
OfficeMate Freezes on login or does not load after login credentials are input.
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Suggested Courses

721 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