HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMajor

How do I generate a tnsnames.ora file to connect to an Oracle Database?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
fileconnectdatabasegenerateorahoworacletnsnames

Problem

I have installed Oracle 11g, and I can connect as sysman to the Oracle database, but there is no tnsnames.ora file that I can find.

Do I need to generate the tnsnames.ora file myself? If so, where do I place it? If not, how does Oracle generate it for me? If I do need to generate it, what is the appropriate syntax for the file?

Solution

You can easily create a tnsnames.ora [text] file. It should be in $ORACLE_HOME/network/admin/ and should look something like this:

ORATST=
 (description=
   (address_list=
     (address = (protocol = TCP)(host = fu.bar)(port = 1521))
   )
 (connect_data =
   (service_name=oratst)
 )
)

Code Snippets

ORATST=
 (description=
   (address_list=
     (address = (protocol = TCP)(host = fu.bar)(port = 1521))
   )
 (connect_data =
   (service_name=oratst)
 )
)

Context

StackExchange Database Administrators Q#28326, answer score: 21

Revisions (0)

No revisions yet.