Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

When I do an updatedb and locate tnsnames.ora I get back a long list due to various Oracle DB installations. I need to add some entries to whichever is the "default" tnsnames.ora configured for the system.

How do I find out which of the many tnsnames.ora files is actually being used?

note: none of the 30 odd instances are under any "system" folders (e.g. /etc /usr etc) and:

> echo $TNS_ADMIN
TNS_ADMIN: Undefined variable.
> echo $PATH
/usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/local/ade/bin:/usr/NX/bin
> echo $ORACLE_HOME
ORACLE_HOME: Undefined variable.

RHEL4

share|improve this question
add comment

2 Answers

If $TNS_ADMIN is not set, then the tnsnames.ora should be in $ORACLE_HOME/network/admin/.

You can find more explanations on tnsnames.ora in Net Services Reference book.

To determine the value of $ORACLE_HOME, you can look at the file /etc/oratab. This file list database, the associated $ORACLE_HOME and if the DB must be started/stoped automatically.

You can also find some informations in the oraInventory (have a look at /etc/oraInventory folder or /etc/oraInst.loc file)

share|improve this answer
    
thanks for the answer but $ORACLE_HOME is also undefined - have amended question. –  TiGz Nov 5 '10 at 14:27
    
ok actually doing a ps -eaf I can see that oracle home is being set by the relevent process... and in fact there is no instance of tnsnames.ora under OH/network/admin so I will create one and try that. –  TiGz Nov 5 '10 at 14:50
1  
As said by DCookie, you MUST define ORACLE_HOME to be able to launch Oracle process. –  Benoit Nov 5 '10 at 15:07
add comment

Your output above is from the server that has your Oracle installations? Are you logged in as a user that accesses Oracle? I don't see how you could be getting access to anything Oracle based on that output, unless you do so via shell scripts that build your environment each time. It's been a while, but IIRC on *nix systems you must define ORACLE_HOME in order to access Oracle.

If you type:

sqlplus someuser@somedb 

from the above command prompt, what does it tell you? Seems to me it ought to tell you that sqlplus is an unknown command. If not, what does

which sqlplus

tell you?

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.