Skip to content

Where is Tnsnames.ora Location

  • by

tnsnames.ora

Suppose you have known the usage of TNSNAMES, now let's see where we can find it in this post.

In fact, the location of tnsnames.ora depends on what platform you use. Here we introduce two major platforms: Windows and Linux.

1. tnsnames.ora in Windows OS

For Windows OS, the location of tnsnames.ora file is usually at:

%TNS_ADMIN%\tnsnames.ora

Problem is, there's no TNS_ADMIN environment variable in most database systems by default. However, you can use ORACLE_HOME to derive it.

%TNS_ADMIN% = %ORACLE_HOME%\network\admin\

Therefore, the location of tnsnames.ora is usually at:

%ORACLE_HOME%\network\admin\tnsnames.ora

But first of all, you have to know where ORACLE_HOME is in Windows OS before finding the file.

Let's see an example.

tnsnames.ora in Windows

tnsnames.ora in Windows

If there's no tnsnames.ora, please copy one in sample folder for yourself.

2. tnsnames.ora in Linux and Unix-liked OS

For Linux and Unix-like OS, the location of tnsnames.ora file is at:

$ORACLE_HOME/network/admin/tnsnames.ora

Again, you have to know where ORACLE_HOME is in Linux before finding the file.

Leave a Reply

Your email address will not be published. Required fields are marked *