Oracle Connection Strings and Naming Methods


A client uses a connect identifier to connect a client to an Oracle database. A connect identifier is mapped to a connect descriptor containing network details about the database service and passes these details to the listener. The network details in the connect descriptor contains the listener location (protocol address) and the global database name (service name) of the database. The global database name is usually a combination of the database name and the database domain. For instance, with a database name of PROD and a domain of xyz.com, the global database name would be PROD.xyz.com.

The connect descriptor is a database connection string. A connection string is generally a string required to connect a client-based process to a server-based database process. A connection string usually includes a username and password combination plus a database name, with or without protocol specification details. An Oracle connect descriptor is shown below. A connect identifier is resolved to a connect descriptor (database connection string) by using a naming method. A naming method is effectively a method of storing and managing the information about how to connect to a database listener. Thus a client can connect to listener on a database server from any node using a naming method configuration file which maps a connect identifier to a connect descriptor or connection string.

CONNECT <username>/<password>@(description=(protocol=tcp)(host=<hostname>)(port=1521))(connect_data=(service_name=PROD.xyz.com)))

The connect descriptor above can become a more simple format of CONNECT <username>/<password>@<service name>. This is done by placing the connect descriptor definition into the listener configuration file on the server. A naming method stores the lengthy details of the connect descriptor in a configuration file. This Oracle calls a connect identifier. A connect identifier is defined using one of five different naming methods.

What is an Oracle Net8 Connect Identifier ?

Naming Methods

Naming methods fall into two categories, localised and centralised. Connect identifiers are resolved into connect descriptors using localised naming or a centralised service. A centralised naming service implies a naming resolution service residing on the same or a separate node but acting solely as a naming service and network route (router) forwarding or address provision service for client process database connection requests.

Localised naming is configured by placing connect descriptors into a local node file called $ORACLE_HOME/network/admin/tnsnames.ora. Centralised naming involves the use of a naming service, sometimes on a dedicated names service node. The centralised naming server can be of four types.

  1. Host naming - connections resolved using host name aliases. Host name aliases can be resolved to network routing addresses such as IP-Addresses using names resolution services such as DNS (Directory Name Service) or NIS (Network Information Services). DNS configuration is generally stored on a Unix Solaris box in the /etc/hosts and the /etc/resolv.conf files.

  2. Directory naming - an LDAP compliant directory server provides naming resolution.

  3. Oracle Names server - stores Oracle services and net service names.

  4. External naming - uses third party naming services.