You're invited to submit your Oracle-related questions to us at askdbspecialists09@dbspecialists.com. Include your name and telephone number in your email. If your question is answered in The Specialist next month, you will receive a free copy of our Oracle Wait Events reference poster. (US shipping addresses only).
This month’s question comes to us from Janet in New York: Our organization has application servers and development groups located in multiple sites in the US. We are looking at options for implementing centralized naming services (e.g. Oracle Names or Oracle Internet Directory) to simplify database migrations and disaster planning. What are the main advantages and issues with these services?
Ian Jones of the Database Specialists team responds: Centralized naming services are typically used when there are many clients that use Oracle networking software. Both Oracle Names and Oracle Internet Directory (OID) eliminate the need for a tnsnames.ora file on each client. In place of the tnsnames.ora file, each client is configured to access the centralized naming service to resolve database connect strings.
A key advantage of centralized naming services is that database connect strings can be managed from a single repository. This means that databases can be moved to different servers or ports without needing to change configuration files on every client machine. For example, during a disaster it could be necessary to re-point all client machines to an activated standby database. This is a straightforward update if you are using Oracle Names or OID, but without such a service you would need to update the tnsnames.ora file on all client machines. That could be a challenge, especially in the midst of a disaster.
One downside to having a centralized configuration is that an Oracle Names or OID problem will potentially affect all clients trying to establish database connections. Care needs to be taken to produce a configuration that is highly available!
Oracle Names is the older centralized naming service, dating back to the Oracle v7 days. It can be used by Oracle v7, v8, 8i, and 9i clients but not by Oracle 10g clients. Oracle Names was specifically designed for database connect string name resolution and typically consists of one repository and multiple name server processes running on different hosts, each of which reads from the repository at periodic intervals.
When an Oracle Names server process reads from a repository, it writes the information to local checkpoint files which it then uses to service requests until the next read from the repository. If the repository becomes unavailable the name server process simply uses the checkpoint files to resolve requests. Having a backup repository (e.g. a hot standby) and multiple name server processes running on different hosts ensures that there is no single point of failure.
A client only needs a sqlnet.ora file in the network/admin directory to access an Oracle Names server. A sample sqlnet.ora file looks like this:
NAMES.PREFERRED_SERVERS=
(
ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=names_1)(PORT=1643))
(ADDRESS=(PROTOCOL=TCP)(HOST=names_2)(PORT=1643))
)
NAMES.DEFAULT_DOMAIN=YOURDOMAIN.COM
NAMES.DIRECTORY_PATH=(ONAMES)
Note that names_1 and names_2 are the host names of the servers running the Oracle Names processes.
OID, the newer centralized naming service, is an LDAP v3 compliant directory service. In other words, OID is an LDAP server that can be used to store any suitable data—one such use is to hold Oracle database connection information. OID can be accessed by Oracle 8i, 9i, and 10g clients, but it cannot be used by Oracle v7 or v8 clients.
For high availability purposes you will need at least two OID repositories. They are kept in sync automatically using Oracle asynchronous multi-master replication on a single table. OID does not use checkpoint files, so at least one of the repositories must be available at all times to avoid problems.
A client needs a sqlnet.ora file and an ldap.ora file in the network/admin directory to access OID. A sample sqlnet.ora file looks like this:
NAMES.DIRECTORY_PATH=(LDAP)
NAMES.DEFAULT_DOMAIN=YOURDOMAIN.COM
A sample ldap.ora file looks like this:
DEFAULT_ADMIN_CONTEXT = "dc=yourdomain,dc=com"
DIRECTORY_SERVERS= (names_1:1644, names_2:1644)
DIRECTORY_SERVER_TYPE = OID
If you have applications that require a pre-8i version of the Oracle client software and you also have Oracle 10g clients, then you will need to run both Oracle Names and OID concurrently to make centralized naming available to all Oracle clients. The Oracle 9i version of Oracle Names can be configured to read from an OID repository—a feature known as “Oracle Names LDAP Proxy.”
The LDAP proxy is necessary to avoid having to maintain both the Oracle Names and OID repositories simultaneously. With the LDAP proxy you make naming changes in a single OID repository and the changes will be available to all Oracle client versions ranging from Oracle v7 to Oracle 10g.
One networking issue to be aware of is that when the host running the primary name server (the first entry in NAMES.PREFERRED_SERVERS in sqlnet.ora or DIRECTORY_SERVERS in ldap.ora) is down or cannot be contacted because of network problems, there will be a delay equal in duration to a TCP/IP timeout before the second name server is contacted. This delay will not occur if the primary host is available but its name server is shut down. To minimize connection delays caused by unavailable name servers, and to provide maximum flexibility, it is advisable to use DNS aliases for the centralized name servers. This allows aliases such as names_1 and names_2 to be re-pointed to other physical hosts if necessary.
If any clients are using Oracle 10g release 1 client software, you should be aware of bug 3868521. This bug causes only the last value for a parameter specified in ldap.ora to be used. In particular, when you have multiple values specified for the DIRECTORY_SERVERS parameter only the right most one is used. This prevents OID from failing over as it should.
In summary, centralized naming services simplify management of database connect strings when many database clients are involved. OID is a sophisticated service that can be used to manage more than just database connect strings. Unfortunately, older Oracle clients cannot use it. Oracle Names, the older offering, has been replaced by OID and cannot be used by Oracle 10g clients.