Database News You Can Use
A monthly newsletter for Oracle users
You’re invited to submit your Oracle-related questions to us at firstname.lastname@example.org. 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:
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.
Regularly, the team at Database Specialists publishes Oracle-related white papers to share with the Oracle user community. Many of these papers have become very popular—including our works on performance tuning and our step-by-step installation guides. We’ve recently organized these free resources into categories, and here is an at-a-glance sampling for you of some of the many papers available to you on our website:
As issues come up for you at work, see if the papers in our library would be of help to you. You’ll find them at http://dbspecialists.wpengine.com/presentations.html.
If you’ve been an Oracle devotee for a long time, you’ve probably wondered how it compares to Microsoft’s SQL Server product. Authors David Gornshtein and Boris Tamarkin have taken on this subject in a 29-page paper entitled Oracle 10g vs. MS SQL Server 2005: Features, Strengths and Weaknesses Comparison Between MS SQL 2005 (Yukon) and Oracle 10g Databases.
Their paper provides a feature comparison intended for database administrators, including VLDB and OLTP features, performance issues, provided utilities, and replication. The authors also outline several new features developed by Microsoft in order to provide competitive functionality to the Oracle database. Additional items reviewed include the subjects of backup and recovery, application features, and data export/import. Finally, you’ll also find a section that covers useful Oracle features that don’t have any comparable SQL Server features (and vice versa).
You’ll find the paper here.
If you missed the summer conference of the Northern California Oracle Users Group, you missed a great meeting kicked off by a keynote from Chris Date, a founding father of relational theory. Now that the conference has passed, you can check out the listing of presentations the speakers have made available. Topics to choose from include:
You’ll find these presentations, and more, available for download at http://www.nocoug.org/presentations.html.