3.3 Keep a Standard sqlnet.ora File

027 - Keep a Standard sqlnet.ora File <p><script> function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window. open (url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); } function Print() { window.focus(); if(window.print) { window.print(); window.setTimeout('window.close();',5000); } } </script></p>
Team-Fly    

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


3.3 Configuring Your Profile

After installing the Net8 software, your next task is to configure the Net8 profile. That's a fancy way of saying that you need to edit your sqlnet.ora file. The sqlnet.ora file is found in the $ORACLE_HOME /network /admin directory ( net80/admin for Oracle8) and contains settings that control Net8's operation.

Appendix A, describes all the possible settings that you can make in this file. In this chapter, we discuss only those that you are most likely to need. These include:

  • The list of naming methods to use, and the order in which to try them

  • Your default Net8 domain

  • The directory and filename to use for Net8 trace files

  • The directory and filename to use for Net8 log files

The sqlnet.ora file is a text file. You can choose to edit it using a text editor and manually enter the parameter settings that you need, or you can use Oracle's Net8 Assistant to set the parameters using a GUI interface.

Keep a Standard sqlnet.ora File

Consider creating and keeping a standard sqlnet.ora file for your site. Many DBAs do this because even though Net8 gets installed on a large number of clients , it's usually configured the same on each. If you have a standard sqlnet.ora file, all you need to do is copy it over the one created during the Net8 client install process. This is easier than creating a new file from scratch each time. It's also more reliable, because you remove the risk of overlooking needed parameter settings. The tnsnames.ora file, which you will learn about in the next section, can be managed the same way.

3.3.1 Choosing a Naming Method

Recall from Chapter 2, that the naming method determines the manner in which Net8 resolves a net service name to a specific database on a specific server. You have a choice between the five methods shown in Table 3.1.

When you configure a client, you choose which naming method (or methods) to use. You can use the NAMES .DIRECTORY_PATH parameter in the sqlnet.ora file to do this.

If you choose to support multiple naming methods, you must also use the NAMES.DIRECTORY_PATH parameter to specify the order in which they are tried. When Net8 goes to resolve a net service name, it will work its way through the naming methods that you have chosen , in the order that you specify, until it successfully resolves the name to a specific database and server.

3.3.1.1 Syntax for NAMES.DIRECTORY_PATH

Here is the syntax to use when setting the NAMES.DIRECTORY_PATH parameter in the sqlnet.ora file:

 NAMES.DIRECTORY_PATH = (  method  [,  method  ...]) 

Replace method in the syntax with one of the keywords shown in Table 3.2.

Table 3.2. NAMES.DIRECTORY_PATH Keywords

Method

Keyword

Description

Local naming

TNSNAMES

Names are resolved by looking them up in a file on the client named tnsnames.ora .

Directory naming

LDAP

Names are resolved by querying an LDAP-compliant directory such as the Oracle Internet Directory (OID) or the Microsoft Active Directory (MAD).

Centralized naming

ONAMES

Names are resolved by querying a central Names server running Oracle Names software.

Host naming

HOSTNAME

Names are resolved by querying a DNS server. This is a TCP/IP-only solution, and only works when the name of a database is identical to the name of the server on which it resides.

External naming

DCE

Names are resolved using the Distributed Computing Environment's (DCE) Cell Directory Services (CDS).

External naming

NIS

Names are resolved using Network Information Service (NIS).

External naming

NOVELL

Names are resolved using Novell Directory Services (NDS).

The default setting for NAMES.DIRECTORY_PATH is:

 NAMES.DIRECTORY_PATH = (TNSNAMES, ONAMES, HOSTNAME) 

If you're new to Net8 and uncertain how best to set this parameter, leave it at the default. You can always change it later, and the default setting is reasonable. If you know for certain that you aren't running Oracle Names, you can eliminate that method from the list.

3.3.1.2 Choose what you use

Try to keep the number of naming methods listed in the NAMES.DIRECTORY_PATH parameter as low as possible. Net8 must try each method that you list. If you (or a user ) enter an invalid net service name, the more naming methods that Net8 must try, the longer it will take before Net8 gets back to you with an error message.

If yours is one of the many Oracle installations that uses only tnsnames.ora files to resolve net service names, then use the following setting:

 NAMES.DIRECTORY_PATH = (TNSNAMES) 

If you're using Oracle Names, with perhaps a few exceptions defined in local tnsnames.ora files, then use one of the following settings:

 NAMES.DIRECTORY_PATH = (ONAMES, TNSNAMES) NAMES.DIRECTORY_PATH = (TNSNAMES, ONAMES) 

The first setting causes Oracle Names to be checked first. The tnsnames.ora file will only be checked for net service names not found in the central database. The second example turns this around, and checks tnsnames.ora first. This can be useful for developers because it allows them to redirect a net service name to a test database.

3.3.2 Choosing a Default Domain

Net service names may be qualified by a Net8 domain name. In this respect, they are similar to TCP/IP hostnames. The standard dot notation is used to separate the elements in a net service name. Here are some examples:

 herman herman.world herman.gennick.org 

The first name has no domain at all. The second has a domain of world . This was the default domain used in SQL*Net and Net8 through the release of Oracle8. The third example shows a net service name with a domain of gennick.org , which resembles a DNS domain. This is the model that Oracle now recommendsmaking your Net8 domain structure mirror your DNS directory structure.

It's possible to run a Net8 network without using domains at all. But if you do use domains, the net service names quickly become long and cumbersome. Who wants to type in herman.gennick.org each time they connect to a database? For this reason, Oracle enables you to define a default domain that is automatically appended to any net service name that you enter.

3.3.2.1 Syntax for NAMES.DEFAULT_DOMAIN

You use the NAMES.DEFAULT_DOMAIN parameter in your sqlnet.ora file in order to define the default Net8 domain for that client. The syntax of the entry looks like this:

 NAMES.DEFAULT_DOMAIN =  domain  

You can replace domain in the syntax with whatever domain you wish to append to unqualified net service names. Here are some possible settings:

 NAMES.DEFAULT_DOMAIN = WORLD NAMES.DEFAULT_DOMAIN = GENNICK.ORG NAMES.DEFAULT_DOMAIN = jonathan.gennick.org 

Net service names are not case-sensitive. Either upper or lowercase may be used when defining a default domain.

When directory naming (LDAP) is used, the default domain setting has no relevance. Instead, you need to set DEFAULT_ADMIN_CONTEXT in your ldap.ora file. See Chapter 6, for details.

3.3.2.2 How default domains are used

It's important to understand exactly when default domains are applied in the Net8 name resolution process and the effect they have. One of the most common Net8 configuration errors that we see is to omit, or mistakenly set, the default domain.

The flowchart in Figure 3.7 shows the process that Net8 goes through in order to qualify service names that you enter.

Figure 3.7. Net8 checks for, and applies, default domains to net service names that you enter
figs/n8c_0307.gif

The key thing to observe in Figure 3.7 is that the default domain is applied before any name resolution is attempted. When you define net service names in a tnsnames.ora file, or to Oracle Names, you must use the fully qualified names. When an application attempts to connect to an Oracle database via Net8, the combination of the service name supplied by the application and the default domain defined in sqlnet.ora must match a net service name defined in tnsnames.ora , Oracle Names, or some external source. Table 3.3 provides some examples.

Table 3.3. Default Domain Examples

Net Service Name

Default Domain

Result

herman

world

herman.world

herman

gennick.org

herman.gennick.org

herman.

gennick.org

herman

herman.gennick

org

herman.gennick

Any time you enter a net service name containing a dot, Net8 assumes that the name is already fully qualified, and consequently does not append the default domain onto what you have entered. The last two entries in Table 3.3 demonstrate this.

3.3.3 Choosing the Trace File Location

For debugging purposes, it's sometimes handy to generate Net8 trace files. By default, Net8 places these files in the $ORACLE_HOME/network /trace directory, and names them sqlnet.trc . You can use the TRACE_DIRECTORY_CLIENT and TRACE_FILE_CLIENT parameters in the sqlnet.ora file to specify some other location and name. For example:

 TRACE_DIRECTORY_CLIENT = /home/oracle/trace TRACE_FILE_CLIENT = net8.trc 

These two settings control trace file generation when Net8 is acting as a client. When Net8 is acting as a server, you must use the TRACE_DIRECTORY_SERVER and TRACE_FILE_SERVER parameters. These are discussed in Chapter 4. For information on generating and using Net8 trace files, see Chapter 10.

The Windows NT version of Net8 release 8.1.5 always appends .trc to whatever you specify as a trace filename. If you specify TRACE_FILE_CLIENT = net8.trc , then the resulting file will be named net8.trc.trc . This rather odd behavior does not occur on Unix and Linux systems.

You should not specify the root directory of a drive as the trace directory. Don't try to use / on Unix, and don't try to use C:\ under Windows. You won't get a trace file if your trace directory is the root directory of a drive. You must specify a subdirectory.

3.3.4 Choosing the Log File Location

Net8 maintains a log file to which it writes information about significant events and especially about error messages. The default location for the Net8 log file is $ORACLE_HOME/network /log , and the default name is sqlnet.log . You can use the LOG_DIRECTORY_CLIENT and LOG_FILE_CLIENT parameters to specify another location and name. Here's an example:

 LOG_DIRECTORY_CLIENT = $ORACLE_HOME/network/log LOG_FILE_CLIENT = net8client.log 

As with trace files, these parameters control log file location and name when Net8 is acting as a client. Separate parameters control the name and location of Net8 server log files.

3.3.5 Using the Net8 Assistant to Configure Your Net8 Profile

Oracle8 i includes a Java application named the Net8 Assistant that allows you to configure your Net8 profile using a GUI interface. On Windows-based systems, you start the Net8 Assistant from the Start menu using the following path :

Start figs/u2192.gif Programs figs/u2192.gif Oracle - OraHome81 figs/u2192.gif Network Administration figs/u2192.gif Net8 Assistant

On Unix and Linux systems, the Net8 Assistant runs under the X Windows system, and you start it using the netasst command. The netasst executable will be in your $ORACLE_HOME/bin directory, which should be part of your search path. Figure 3.8 shows the Net8 Assistant's screen.

Figure 3.8. Editing your profile with Net8 Assistant
figs/n8c_0308.gif

The callouts in Figure 3.8 show you where you can find the profile settings that have been discussed in this chapter. Net8 Assistant's operation is fairly intuitiveit pretty much works like any other GUI, so we won't discuss the details in this chapter. If you understand how to edit a sqlnet.ora file by hand using a text editor, you won't have any trouble using the Net8 Assistant.


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