Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to valid the TNS names setup in tnsnames.ora?
"Huy Vu" <huyv_at_usa.net> wrote in message news:3bde2633_2_at_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
>
>
>
>
>
Huy,
In UNIX there is TNS_ADMIN variable which by default is set to ${ORACLE_HOME}/network/admin. If someone changed then you should check for ${TNS_ADMIN} value while searching tnsnames.ora file.
Hope that helps.
Trifon Anguelov
Senior Oracle DBA
http://www.dbaclick.com Received on Tue Oct 30 2001 - 13:38:56 CST
![]() |
![]() |