Appendix B. The tnsnames.ora File

The tnsnames.ora file is a text file used by Net8 to resolve net service names when local naming is used. By default, tnsnames.ora resides in the $ORACLE_HOME/network /admin directory.

Understanding the syntax used for tnsnames.ora entries is a key requirement for using almost any Net8 functionality. The same syntax used to define net service names in tnsnames.ora is also used to define net service names when Oracle Names or an LDAP-based repository such as the Oracle Internet Directory is used for name resolution.

Net Service Name Definitions

The primary purpose of an entry in the tnsnames.ora file is to link a net service name with a set of attributes that can be used to connect a client to an Oracle database. These attributes are loosely organized into the following two major categories:

  • The protocol address or addresses

  • The connection data

The protocol address for a net service name points the client to the physical server on which a database instance is running. You might also refer to a protocol address as a network address. The connection data identifies the specific database instance or service, running on that server, to which the client is to connect.

Descriptions and Description Lists

Taken together, the combination of a protocol address and connection data is referred to as a description . Most net service name definitions are fairly simple and consist of just one description. Here’s an example:

DONNA.GENNICK.ORG = (DESCRIPTION = (ADDRESS_LIST ...

Get Oracle Net8 Configuration and Troubleshooting now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.