Solved

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

Posted on 2014-11-20
7
366 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
On some Windows 7 (SP1) computers, Windows Update becomes super slow even the computer is reasonably fast.  There's one solution that seemed to have worked well for me (after trying a few other suggested solutions).
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

776 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