Problem with TNS_ADMIN in .profile


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with TNS_ADMIN in .profile
# 1  
Old 06-21-2011
Problem with TNS_ADMIN in .profile

Hi!

In my .profile I have a line that says
Code:
export TNS_ADMIN=$HOME

I received the .profile file from a colleague who uses it to access SQL*Plus from a UNIX server. When I try the same method he uses I get
Code:
ORA-12154: TNS:could not resolve the connect identifier specified

which makes me think that this TNS_ADMIN line is causing the error since my copy of tnsnames.ora is located at
Code:
C:\Oracle\product\10.1.0\Client_1\network\ADMIN

. My attempts at pointing to that location has failed. Does anyone have a suggestion?

Thanks!

Last edited by pludi; 06-21-2011 at 06:58 PM..
# 2  
Old 06-23-2011
How's the permissions on tnsnames.ora ?
# 3  
Old 06-27-2011
Quote:
Originally Posted by DGPickett
How's the permissions on tnsnames.ora ?

I have read/write on the tnsnames.ora file (I've done minor edits as needed). I'm not sure though if .profile should be pointing from the UNIX environment to somewhere within the UNIX environment or to a location on the Windows box I'm operating from ...
# 4  
Old 06-27-2011
A tnsnames.ora file is read by the Oracle listener when it starts on the computer where the database resides.
Another tnsnames file is read by the client computer to initialise the client-server session.
i.e. Each computer has its own copy.
The client and server copies should be consistent for the section relevant to that connection. They don't have to be identical because a server could offer multiple listeners for different purposes.

I can't see why tnsnames.ora would be mentioned in a unix .profile - even for account "oracle". The unix .profile is used to initalise a "telnet" session. It would be more ususal to mention tnsnames.ora in a script which starts the listener in background.

Tnsnames.ora - Oracle FAQ

Last edited by methyl; 07-01-2011 at 08:27 AM..
# 5  
Old 06-27-2011
As I recall, it is configured via environment, so .profile is fair game to support all oracle products launched in the session, like SQL*PLUS or PRO-C compiled applications.
Configuring SQL*Plus

You can connect without tnsnames.ora, by putting the right section on the command line or wherever appropriate, but why? Get a copy of the file.
Ask Tom "How to connect SQLPlus without tnsnames..."

Last edited by DGPickett; 06-27-2011 at 05:16 PM..
# 6  
Old 06-27-2011
In your case the TNS_ADMIN is used to locate the Oracle*Net configuration. It should point to where your Oralce*Net services are defined: the tnsnames.ora (and eventually sqlnet.ora, ldap.ora etc.) files on your client.

If you unset TNS_ADMIN and set ORACLE_HOME correctly, your client will search for tnsnames.ora
in the $ORACLE_HOME/network/admin directory on your client machine (and in other places, but I don't think you need these details now).
# 7  
Old 06-27-2011
That's what the first link above says. Since you probably need ORACLE_HOME even worse, why not use the default location? It might not be right, the owner might be on vacation, or you like config bits elsewhere from installed code!

Configuring SQL*Plus
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Problem with profile

i have a bash_profile in this profile there are my variable but when i do csh there aren't my variables .set how can i do ? regards Franc (1 Reply)
Discussion started by: Francesco_IT
1 Replies

2. UNIX for Dummies Questions & Answers

.profile script problem

I am using MacOSX, and I decided to change the way my terminal looks. So, I created a ~/.profile file that has only the line export PS1="\\u\ @ \\W \($0) \\$ \" ( '\u' displays the current user '\W' displays the Working dir and the weird numbers are colors) It works fine when I log in... (3 Replies)
Discussion started by: TX0
3 Replies

3. Shell Programming and Scripting

problem in creating my own profile file in unix

I am new in shell scripting. currently i am using cygwin. My problem is i created a profile file in my own folder. file name is first.profile in which i gave following values to variable export a=10 now i am executing this profile file by below command ./.first.profile it executed... (4 Replies)
Discussion started by: pratikjain998
4 Replies

4. Shell Programming and Scripting

How can we hardcode TNS_ADMIN?

How can we hardcode TNS_ADMIN? When i try to connect to db with the code below..i get TNS issue. So wpndering if i can hardcode TNS.. <html> <head> <title>xxxxxxxxxxxxxx</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <% ### Load modules, connect to... (2 Replies)
Discussion started by: rdhanek
2 Replies

5. Shell Programming and Scripting

problem with profile-autosys

Hi All, I have trying to schedule an autosys job and it is failing. The shutdown script runs fine by itself from the UNIX box but fails when i try to schedule it through autosys. I have compared user.env with auto.env (variables obtained through an autosys script) and updated my profile... (1 Reply)
Discussion started by: userscript
1 Replies

6. Solaris

profile problem

for some reason my profile doesnt seem to be loading. here is some info $SHELL /sbin/sh $HOME / (yup, im running at root, its a VM and im using it to learn) created /.profile added something simple to test, PS1="test" logout and back in, open a terminal... prompt is still # ... (2 Replies)
Discussion started by: jrich523
2 Replies

7. Shell Programming and Scripting

problem with .profile

I am trying to execute my .profile which has the path to oracle home. But when I execute it with the below command it says nothing and when I try to echo the ORACLE_HOME I am still in my home directory itself which means it didn't get executed. Please help how to make sure that .profile is... (6 Replies)
Discussion started by: dsravan
6 Replies

8. UNIX for Dummies Questions & Answers

.profile problem using set -o vi

The “set -o vi” command won't run in the .profile. WHY? This has me puzzled as the problem seems to be too simple, but can't figure it out. Here's the info... Running... Generic sun4u sparc SUNW,Ultra-5_10 K shell Here's the .profile # Copyright (c) 2001 by Sun Microsystems, Inc. # All... (12 Replies)
Discussion started by: jimmyc
12 Replies

9. UNIX for Dummies Questions & Answers

problem with .profile

Hi, i am changing something in .profile file and then esc :wq!. when i do the cat i can see the changes. but to bring the .profile in memory i have to do . .profile.but it says error while doing that is . .profile ksh: .profile: not found. can any body help thanks in advance sam71 (7 Replies)
Discussion started by: sam71
7 Replies

10. UNIX for Dummies Questions & Answers

Problem with .profile

I wanted to add /home/oracle/sql to my path so that from which ever directory i connect to sqlplus i should be able to source the .sql files sitting in /home/oracle/sql. Also, this is what i tried but it doenst work # Set up the search paths: export ... (2 Replies)
Discussion started by: jigarlakhani
2 Replies
Login or Register to Ask a Question