3.6 Using Oracle Names

Team-Fly    

 
Oracle Net8 Configuration and Troubleshooting
By Jonathan  Gennick , Hugo Toledo
Table of Contents
Chapter 3.  Client Configuration


3.6 Using Oracle Names

Oracle Names is Oracle's older software that implements a centralized naming service. Instead of defining net service names in tnsnames.ora files that reside on each client, you can define them once to a centralized name server. See Chapter 2 and Chapter 7 for more details.

To configure Oracle Names on a client, you need to perform the following tasks :

  • Choose Oracle Names as a naming method

  • Tell your client which Names servers to use

  • Configure other Oracle Names related settings

You've already seen how to choose which naming methods to use earlier in this chapter in Section 3.3. If you choose to use Oracle Names, your client must know which Names servers to use.

3.6.1 Identifying Names Servers

In order for a client to use Oracle Names, it has to know about the Oracle Names servers that are out on the network. You can define these Names servers manually, or you can automatically discover them using either the Names Control utility or the Net8 Assistant. Automatic discovery is the easiest approach, but it only works if you have configured your Names servers using the following well-known Oracle Names server addresses:

(PROTOCOL=TCP)(HOST=oranamesrvr0)(PORT=1575)
(PROTOCOL=TCP)(HOST=oranamesrvr1)(PORT=1575)
(PROTOCOL=TCP)(HOST=oranamesrvr2)(PORT=1575)
(PROTOCOL=TCP)(HOST=oranamesrvr3)(PORT=1575)
(PROTOCOL=TCP)(HOST=oranamesrvr4)(PORT=1575)
(PROTOCOL=TCP)(HOST=oranamesrvr5)(PORT=1575)

In addition, the discovery process only finds Names servers that are in your particular domain. If your default domain is gennick . org , then you will only find Names servers in the gennick.org domain . If you prefer, you can define names manually using the NAMES.PREFERRED_SERVERS initialization parameter.

3.6.1.1 Discovery using NAMESCTL

Oracle Names Control is a command-line utility used to control the operation of Oracle Names on both client and server machines. You can use the utility's REORDER_NS command to search for well known Names servers on the network. For example:

 C:\>  namesctl  Oracle Names Control for 32-bit Windows:  Version 8.1.5.0.0 - Production on 07-MAR-00 12:27:44 (c) Copyright 1997 Oracle Corporation.  All rights reserved. NNL-00024: warning: no preferred name servers in SQLNET.ORA NNL-00018: warning: could not contact default name server Welcome to NAMESCTL, type "help" for information. NAMESCTL>  reorder_ns  NAMESCTL> 

The discovery process initiated by the REORDER_NS command takes several minutes, so you have to be patient. When it's finished, you'll have a file named sdns.ora in your $ORACLE_HOME/network /names directory that lists the Names servers that were discovered . The contents of the sdns.ora file look like this:

 \ = (ADDRESS=(PROTOCOL=IPC)(KEY=ONAMES)) jonathan.gennick.org = (ADDRESS = (PROTOCOL = TCP)(HOST = oranamesrvr0)                        (PORT = 1575)) 

In the sdns.ora file, the Names servers are listed in order of fastest response. During the discovery process, Oracle Names Control pings each names server. The time it takes each Names server to respond determines its place in sdns.ora , with the fastest responding names server listed first. This is probably the basis for the rather counterintuitively named REORDER_NS command.

If you plan to do any other work in Oracle Names Control after using the REORDER_NS command, either exit and reenter the utility, or use the SET SERVER command to select a names server on which to operate .

If you issue the SET SERVER command without specifying a name, you may have to wait a minute or so for a response. When you get a prompt back, the current Names server will be set to one of those listed in sdns.ora .

3.6.1.2 Discovery using Net8 Assistant

If you use the Net8 Assistant to discover Names servers, the results are the same as if you had used Oracle Names Control. Net8 Assistant just provides a GUI interface.

To initiate discovery from the Net8 Assistant, click on the Oracle Names Servers folder, and select Discover Oracle Names servers from the Command menu as shown in Figure 3.12.

Figure 3.12. Using Net8 Assistant to discover names servers
figs/n8c_0312.gif

The discovery process takes a minute or two, after which you will have an sdns.ora file just like the one created by Oracle Names Control's REORDER_NS command. After the discovery, Net8 Assistant prompts you to exit and restart the program. This is necessary if you plan to do further work using Net8 Assistant. Otherwise, just exit the program without restarting.

3.6.1.3 Defining preferred names servers

If your Names servers don't use the well known Names server addresses, or if you just want to be specific about the order in which they are used, you can define them using the NAMES.PREFERRED_SERVERS parameter in your sqlnet.ora file. Here's an example:

 NAMES.PREFERRED_SERVERS =  (ADDRESS_LIST =    (ADDRESS = (PROTOCOL=TCP)(HOST=JONATHAN.GENNICK.ORG)(PORT=1575))    (ADDRESS = (PROTOCOL=TCP)(HOST=DONNA.GENNICK.ORG)(PORT=1575))  ) 

When you attempt to connect to a database using a net service name, Net8 contacts the specified Names servers in the order that they are listed. In this case, Net8 will first attempt to contact the Names server at jonathan . gennick . org . If that attempt is unsuccessful , Net8 will try contacting donna . gennick . org .

3.6.2 Other Names-Related Parameters

Aside from the NAMES.DEFAULT_DOMAIN and NAMES.PREFERRED_SERVER parameters, there are several other Oracle Names-related parameters that you can set. Two in particular that you should know about are:

  • NAMES.INITIAL_RETRY_TIMEOUT

  • NAMES.REQUEST_RETRIES

Together, these control the number of name resolution attempts Net8 makes before giving up and returning an error.

3.6.2.1 NAMES.INITIAL_RETRY_TIMEOUT

The NAMES.INITIAL_RETRY_TIMEOUT setting controls the number of seconds that a client waits in order to get a response from a Names server. You specify the wait time in seconds (the default is 15). The following setting specifies a 5-second wait time:

 NAMES.INITIAL_RETRY_TIMEOUT = 5 

When Net8 resolves a net service name through Oracle Names, it first retrieves a list of Names servers from either sdns.ora or the NAMES.PREFERRED_SERVERS parameter. Net8 then tries to contact the first names server in the list. If that contact is successful, that's great. However, if no response is received within the specified wait time, Net8 assumes that the first Names server is down, and moves on to contact the second. Net8 continues this process until it gets a response, or until it has tried all the names servers in the list.

The benefit of cycling through multiple Names servers is that it removes a single point of failure from your system. If one names server goes down, your clients automatically use another. Clients may experience a slight delay when making a connection, but connections will still be made.

3.6.2.2 NAMES.REQUEST_RETRIES

By default, Net8 cycles through the list of Names servers just once. If no names server can be contacted, Net8 returns an error. The NAMES.REQUEST_RETRIES parameter allows you to have Net8 cycle through the list of Names servers more than once. The following line, placed in your sqlnet.ora file, will cause Net8 to try each Names server up to a maximum of three times:

 NAMES.REQUEST_RETRIES = 3 

When resolving a net service name, Net8 still tries each Names server listed in either sdns.ora or NAMES.PREFERRED_SERVERS. Now, however, it will cycle through the list three times instead of once before giving up and returning an error.

Be careful about setting a value that's too high for NAMES.REQUEST_RETRIES. Keep in mind that the potential delay for a connect request becomes the value computed by the following formula:

 initial_retry_timeout * request_retries * number_of_names_servers 

If you have 5 Names servers, an initial retry timeout of 5 seconds, and a request retries value of 3, then you have a potential wait time of 75 secondsif all your Names servers happen to be down. Be sure that you can tolerate that.


Team-Fly    
Top
 


Oracle Net8 Configuration and Troubleshooting
Oracle Net8 Configuration and Troubleshooting
ISBN: 1565927532
EAN: 2147483647
Year: 2000
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net