Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> How to valid the TNS names setup in tnsnames.ora?

How to valid the TNS names setup in tnsnames.ora?

From: Huy Vu <huyv_at_usa.net>
Date: Mon, 29 Oct 2001 23:08:10 -0500
Message-ID: <3bde2633_2@aeinews.>


Hi all,

I usually check if the TNS name defined in $ORACLE_HOME/network/tnsnames.ora configuration file while coding the Unix shell scripts.

For example:

if test grep ORA1 $ORACLE_HOME/network/tnsnames.ora then

   sqlplus user/passwd_at_ORA1 - <<EOT

      @sqlcmd
       exit

EOT
else

   echo "ORA1 not defined in tnsnames.ora!"     exit 1
fi

but in some fail over systems for Oracle, sometime I don't see tnsnames.ora or listener.ora stays in $ORACLE_HOME/network/admin directory so the coding above will not work.

How could I check if the TNS name defined before making the connection to the remote databases?

Thanks in advance for any advise

DH Received on Mon Oct 29 2001 - 22:08:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US