Search the Catalog
Oracle Net8 Configuration and Troubleshooting

Oracle Net8 Configuration and Troubleshooting

By Hugo Toledo & Jonathan Gennick
December 2000
1-56592-753-2, Order Number: 7532
408 pages, $39.95

Chapter 1
Oracle's Network Architecture and Products

In this chapter:
Goals of Net8
Net8 Components
Stack Communications
Management Utilities

Net8 is the fundamental networking technology that allows Oracle services and clients to communicate with each other over a network. The most common application for Net8 is to allow clients to talk to database servers, but Net8 also enables server-to-server and other types of communication, as shown in Figure 1-1.

Figure 1-1. Net8 enables communication between many Oracle services and applications

 

In this chapter, you'll learn about Oracle's architectural goals for Net8. You'll also learn about the major components that make up Net8. Some of these components are behind-the-scenes in that they are only used by the Net8 communications stack. Others are management tools that you invoke directly.

TIP:  

Net8 was originally named SQL*Net. When Oracle8 was released, Oracle changed the name to Net8.

Goals of Net8

The overarching mission of Net8 is fairly obvious: to enable connectivity in an Oracle environment. Oracle wants to make it as easy and painless as possible for developers to connect client applications to an Oracle database. In support of that mission, Oracle has set these goals for Net8:

By meeting these three goals, Oracle has made Net8 a very easy to use connectivity solution. Much of the complexity of dealing with various networking protocols and operating-system platforms has been hidden from the user. A developer or DBA working with Net8 only needs to understand how Net8 works. There's no need to have a detailed understanding of the underlying protocols or the underlying operating systems.

Location Transparency

Location transparency refers to the fact that an application does not need to know anything about the network location of the service to which it is connecting. Node names, IP addresses, and the like are transparent to the application. Net8 needs to know these details, but they are hidden from the application.

Net8 achieves location transparency by associating the network address of a server with a Net8 service name. You then use that Net8 service name in client applications in order to connect to the database server. If the address of the server changes, that change only needs to be made at the Net8 level. Client applications and database links that use the service name are completely unaffected.

Platform Independence

Platform independence refers to the fact that Net8 works the same way regardless of the specific hardware or software platform being used. An application that uses Net8 on Unix does not need to be modified in order to use Net8 on Windows NT or Windows 2000.

Net8 achieves platform independence by implementing common functionality and a common API on each platform that Oracle supports. Most applications, in fact, do not call Net8 directly. Instead, they make calls to the Oracle Call Interface (OCI). The OCI, in turn, interfaces with Net8. The result is that Oracle applications do not need to be aware of the specific hardware and software platform on which they are running.

Protocol Transparency

Protocol transparency refers to the fact that applications using Net8 do not need to be aware of the underlying network protocol being used. Net8 works the same over TCP/IP as it does over SPX or any other networking protocol. In fact, if you need to translate between protocols, the Oracle Connection Manager will do that for you, and it will be totally transparent to the applications involved.

Net8 achieves protocol transparency through the use of protocol adapters. Protocol adapters sit between Net8 and the underlying networking protocol being used. They allow Net8 packets to be transmitted and received using protocols such as TCP/IP or SPX. Figure 1-2 shows how protocol adapters fit into the Net8 equation.

Figure 1-2. Net8 protocol adapters let Net8 function over any supported networking protocol

 

As Figure 1-2 shows, Net8 can support multiple protocols simultaneously. When you define a service name to Net8, you also define the protocol (or protocols) that may be used to reach that service. The database service shown in Figure 1-2 can be reached using either TCP/IP or SPX. Net8 will use whichever protocol is supported by the client machine that is making the connection.

Because the network protocol to use is known only to Net8, it can easily be changed without affecting client applications. All you have to do is make sure that the appropriate adapters are installed and that the Net8 service name definition specifies the protocol to use.

Net8 Components

Just what do you get when you install Net8? What are the tangible components that you as the DBA need to know about and manage? The answers to these questions depend on the complexity of your environment and on the options that you choose or choose not to implement. The next few sections talk about the following Net8 configurations:

As you read these sections, bear in mind that these configurations are not mutually exclusive. They are presented separately to keep the diagrams simple and to keep the discussion focused. The simplest configuration, and the one you'll get by default when you do a fresh install of Oracle, is a dedicated server configuration that does not use any of the other components. However, it's entirely possible for a Net8 environment to use Oracle Internet Directory (or Oracle Names) and Connection Manager to implement the multi-threaded server option, and to still use dedicated server connections as well.

Dedicated Server

A dedicated server environment is one in which each database session communicates with a corresponding server process that has been dedicated to it. Figure 1-3 shows an example of this environment. The term refers to the dedicated server processes that are started for each client connection to the Oracle database.

Figure 1-3. A Net8 dedicated server configuration

 

The following list describes the major components that you'll need to deal with in a simple dedicated server configuration such as that shown in Figure 1-3.

Net8 listener
A process that runs on the server and monitors the network for incoming connection requests. When a connection is made, the listener starts up a dedicated server process and hands off the connection to that process. The listener does not stay involved in the connection after that point.

Net8 session layer
The low-level software that enables Net8 communication over a network. The session layer consists of a generic network interface; a routing, naming, and authentication layer; and the Transparent Network Substrate (TNS). You'll read more about these later in this chapter in the "Stack Communications" section.

sqlnet.ora file
A text file that exists on both the client and the server machines. It contains settings that control various aspects of Net8's operation.

tnsnames.ora file
A text file that translates net service names to specific server addresses and instance names.

listener.ora file
A text file containing settings that control the operation of the Net8 listener.

Although Figure 1-3 only shows one listener, it is possible to configure Net8 to use multiple listener processes on one machine. When you configure multiple listeners, you still have only one listener.ora file. All the parameters for all the listeners are in that one file. See Chapter 4, Basic Server Configuration, for details on configuring Net8 listeners.

Multi-Threaded Server

A multi-threaded server environment is one in which the client connections share access to a pool of shared server processes. In a dedicated server environment, as the number of client connections to an Oracle database increases, the resulting dedicated server processes can quickly eat away at the available CPU and memory resources on the server. This has an adverse impact on scalability; you won't be able to support as many users as you might like. If you expect to have a large number of client connections to your database, you may be able to improve scalability by using Net8's multi-threaded server (MTS) option. The MTS option, illustrated in Figure 1-4, allows one server process to handle more than one client connection.

Figure 1-4. A Net8 multi-threaded server configuration

 

Using the MTS option adds one component to the Net8 environment--the dispatcher process. Whereas in a dedicated server environment each new connection is handed off to a dedicated server process, in an MTS environment, each new connection is handed off to a dispatcher process. Each dispatcher process can handle a large number of client connections. When a client sends a SQL statement to the database to be executed, the dispatcher routes that SQL statement to an available shared server process. The shared server process is analogous to a dedicated server process, except that it is shared by more than one connection. The shared server process takes care of executing the SQL statement, and then returns the results back to the client.

The multi-threaded server option is only beneficial in cases where your client connections sporadically use the database. The idea is that while one connection is sitting idle, another connection can be serviced. Clients with little or no idle time should be connected to dedicated server processes. You can learn more about the MTS option in Chapter 4.

Oracle Internet Directory

Oracle Internet Directory (OID) is not, strictly speaking, a Net8 component. It's an implementation of a standards-based Lightweight Directory Access Protocol (LDAP) directory server. An LDAP directory server such as OID can be used to maintain a central repository of net service names that can be referenced by all clients.

When you connect to an Oracle database, you specify the database in question by supplying a net service name. Somehow, Net8 needs to resolve that service name into a specific Oracle instance on a specific server. One way to do that is through the use of tnsnames.ora files. These are text files that sit on each client machine, and also on the servers, and that contain the information needed to resolve each net service name.

Because they must reside on each machine, tnsnames.ora files do not represent a very scalable solution to the problem of resolving net service names. Every time changes are made, the tnsnames.ora files on all your machines need to be refreshed. You can imagine how burdensome and error-prone that task becomes as the number of machines increases. OID, shown in Figure 1-5, allows you to define net service names in one central repository.

Figure 1-5. A Net8 environment using OID

 

OID is shipped with the Enterprise Edition of the Oracle database software. Currently, if you are licensed for the Enterprise Edition, that confers a license to use OID for the purposes of net service name resolution. Read Chapter 6, Net8 and LDAP, for more information on using LDAP with Net8.

Oracle Names

Oracle Names is a soon-to-be obsolete Net8 component that allows net service names to be defined centrally. It functions in much the same manner as the OID. To resolve a net service name, clients contact an Oracle Names server. The Names server sends back the definition for the name, and the client uses that definition to connect to a database service.

Using Oracle Names allows you to dispense with the tnsnames.ora files, and adds the following two components to your Net8 environment:

Oracle Names
Software that maintains a central repository of net service name definitions

names.ora file
A text file containing settings that control the operation of the Oracle Names server

Oracle Names is a proprietary solution, and it has always been somewhat buggy and difficult to use. Oracle still supports Names because there are sites that continue to use it, but the future lies with OID and LDAP. If you need a centralized net service name repository, we strongly recommend the use of the OID/LDAP solution. If you are currently using Oracle Names, you should already be planning your switch to a directory-based name resolution solution.

Connection Manager

The Oracle Connection Manager is an optional Net8 component that functions much like a router. Connection Manager is shown in Figure 1-6 and provides the following functionality:

Protocol conversion
Connection Manager can convert between two different protocols. For example, Connection Manager can convert an SPX/IPX connection from a client into a TCP/IP connection to a database server.

Connection concentration
Multiple client connections can be combined into one protocol connection to a server.

Access control
Database access may be restricted based on the network address of the client or of the server.

Figure 1-6 shows Connection Manager being used for both protocol conversion and connection concentration.

Figure 1-6. A Net8 environment using Connection Manager

 

Read Chapter 9, Connection Manager, for detailed information on using and configuring Connection Manager.

Stack Communications

Knowing the components of Net8 is only part of the story. You also need to understand how Net8 fits into the architecture of your networking environment. Communication in a networked environment always flows through what is referred to as a stack. A communications stack is a collection of software and hardware layers, each of which plays a specific role in the transmission of information from one application to another. Figure 1-7 shows the typical client and server communications stacks for an Oracle environment.

Figure 1-7. Typical Oracle client and server communications stacks

 

In the environment shown in Figure 1-7, communications from a client application to an Oracle server must flow down through all the layers on the client side, go across the physical network link, and then flow up through all the layers on the server side. The three layers shaded light gray in Figure 1-7 represent the Net8 portion of the stack.

The first Net8 layer in the stack, the Network Interface (NI) layer, provides a generic interface to Net8 functionality. The bottom Net8 layer is the Transparent Network Substrate (TNS). The TNS layer plays a very important role in Net8 communications. It implements a set of generic functions that can be translated to any standard network protocol such as TCP/IP or SPX. You could think of TNS as a generic protocol. Oracle supplies network adapters that then translate TNS functions into protocol-specific calls for the underlying network protocol being used.

The IIOP Stack

Oracle8i supports Java in the database. It also supports Enterprise JavaBeans (EJB) and the Common Object Request Broker Architecture (CORBA). CORBA applications connect to CORBA objects via the Internet Inter-ORB Protocol (IIOP). To support these connections, Net8 supports a new presentation layer known as the General Inter-ORB Protocol (GIOP). The IIOP is then an implementation of GIOP that runs over TCP/IP. The resulting communication stacks are much simpler than the stacks used for typical Oracle applications, and are illustrated in Figure 1-8.

Figure 1-8. Communication stacks in an IIOP environment

 

The stacks shown in Figure 1-7 and Figure 1-8 are not mutually exclusive. Both may be in operation at the same time, depending on the mix of applications in use.

The JDBC Stack

A final variation on the theme of communication stacks revolves around Java Database Connectivity ( JDBC). Java applications can access an Oracle database via the industry-standard JDBC interface, and Oracle provides two sets of drivers to support this: the JDBC OCI (Thick) drivers and the JDBC Thin drivers. The difference lies in whether or not the communications are routed through the Oracle Call Interface (OCI). Figure 1-9 illustrates the two possible JDBC client stacks.

Figure 1-9. Client communication stacks in a JDBC environment

 

The left side of the figure shows the stack used for the JDBC OCI drivers. You can see that communications are quickly routed through the OCI, and that the remainder of the stack looks just like the typical stack shown earlier in Figure 1-7. The OCI version of the JDBC drivers requires that the Oracle Net8 software be installed on the client machine.

When the thin JDBC drivers are used, however, things are quite different. The thin drivers were designed to function without any Oracle-specific software installed. They are implemented entirely in Java and support only TCP/IP. To make this work, Oracle had to implement the requisite Net8 functionality in Java, the result of which is called Java Net. The right side of Figure 1-9 shows the Java Net version of the JDBC stack.

Management Utilities

Oracle supplies several utilities to use in managing your Net8 environment. These include:

The three control utilities are command-line utilities that run on the server and enable you to control the Net8 listener, Oracle Names, and Oracle Connection Manager. The tnsping utility is a debugging tool that does for Net8 what ping does for TCP/IP--it verifies Net8 connectivity between two machines. The final three utilities, two of which are termed assistants, are GUI tools that make the maintenance of the various Net8 configuration files (sqlnet.ora and tnsnames.ora) relatively painless.

Listener Control

The Listener Control utility (lsnrctl ) is your primary interface to the Net8 listener and is often referred to simply as Listener Control. You use Listener Control to start and stop Net8 listeners, report on their status, and change their operational settings. The following example shows Listener Control being used to check the current status of a listener:

C:\>lsnrctl
 
LSNRCTL for 32-bit Windows: Version 8.1.5.0.0 - Production on 17-JAN-00 15:15:57
 
 
(c) Copyright 1998 Oracle Corporation.  All rights reserved.
 
Welcome to LSNRCTL, type "help" for information.
 
LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC0)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 32-bit Windows: Version 8.1.5.0.0 - 
                          Production
Start Date                17-JAN-00 10:24:05
Uptime                    0 days 4 hr. 51 min. 54 sec
Trace Level               off
Security                  ON
SNMP                      OFF
Listener Parameter File   E:\Oracle\Ora81\network\admin\listener.ora
Listener Log File         E:\Oracle\Ora81\network\log\listener.log
Services Summary...
  COIN                    has 1 service handler(s)
  PLSExtProc              has 1 service handler(s)
  JONATHAN                has 3 service handler(s)
The command completed successfully

You'll see examples of Listener Control being used throughout this book.

Names Control

The Oracle Names Control utility (namesctl ) is used to manage Oracle Names servers. Like Listener Control, Names Control allows you to start, stop, and check the status of a Names server. Names Control also allows you to perform a number of other administrative tasks relative to managing an Oracle Names environment. The following example shows Names Control being used to check the status of an Oracle Names server:

[oracle@donna admin]$ namesctl status
 
Oracle Names Control for Linux: Version 8.1.6.0.0 - 
Production on 05-SEP-2000 11:17:33
 
(c) Copyright 1998, 1999, Oracle Corporation.  All rights reserved.
 
Currently managing name server "oranamesrvr1"
Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production"
 
Version banner is "Oracle Names for Linux: Version 8.1.6.0.0 - Production"
 
Server name:                              oranamesrvr1
Server has been running for:              10.14 seconds                    

Chapter 7, Oracle Names, discusses Names Control in detail.

Connection Manager Control

The Oracle Connection Manager Control utility (cmctl ), is used to control the Oracle Connection Manager software. The following example shows Connection Manager Control being used to report the current status of Connection Manager:

CMCTL> status
CMAN Status:
(STATUS=(VERSION=8.1.6.0.0)(STARTED=05-SEP-2000 11:19:07)(STATE=running))
ADMIN Status:
(STATUS=(VERSION=8.1.6.0.0)(STARTED=05-SEP-2000 11:19:05)(STATE=RUNNING)) 

Chapter 9, Connection Manager talks about Connection Manager Control in more detail.

tnsping

Oracle's tnsping utility is a very simple utility that verifies Net8 connectivity between two computers. You can read more about it in Chapter 10, Net8 Troubleshooting Techniques. While simple, the tnsping utility can be invaluable in troubleshooting Net8 connections.

Net8 Assistant

The Net8 Assistant is a GUI utility that facilitates the task of editing the various Net8 configuration files. Instead of using a text editor to edit the sqlnet.ora, tnsnames.ora, listener.ora, and names.ora files, you can use Net8 Assistant. Net8 Assistant provides an Explorer-style tabbed user interface that allows you to change Net8 settings using dropdown lists, checkboxes, radio buttons, and other GUI widgets. Figure 1-10 shows Net8 Assistant being used to edit the Net8 tracing parameters.

Figure 1-10. Net8 Assistant allows you to easily edit Net8 configuration files

 

Net8 Assistant frees you from having to remember which .ora file contains the parameters that you want to edit, and from having to remember the sometimes complex syntax used to set those parameters.

Net8 Easy Config

Net8 Easy Config is a GUI utility that allows you to add net service names to your tnsnames.ora file. Net8 Easy Config also allows you to modify, delete, and test those service names. Net8 Easy Config functions much like a wizard in that it leads you step-by-step through whichever process you choose. For example, Figure 1-11 shows the first step in the process of adding a new net service name.

Figure 1-11. Net8 Easy Config allows you to easily edit tnsnames.ora entries

 

The syntax used to define net service names in the tnsnames.ora file is complex, and uses a large number of nested parentheses. The result is often a high error rate when modifications are made manually. Net8 Easy Config was Oracle's response to this high rate of error.

TIP:  

Net8 Assistant provides the same functionality as Net8 Easy Config--it allows you to add service names and, in our opinion, it does so in a fashion that's much easier to use.

Net8 Configuration Assistant

Net8 Configuration Assistant is a GUI wizard-like program that walks you through the process of configuring Net8. Figure 1-12 shows the initial screen where you choose the component of Net8 that you want to configure.

Figure 1-12. Net8 Configuration Assistant allows you to configure various aspects of Net8

 

Net8 Configuration Assistant duplicates much of the functionality found in Net8 Assistant, but it seems more oriented towards generating an initial configuration than in maintaining that configuration over time.

Back to: Oracle Net8 Configuration and Troubleshooting


O'Reilly Home | O'Reilly Bookstores | How to Order | O'Reilly Contacts
International | About O'Reilly | Affiliated Companies

© 2001, O'Reilly & Associates, Inc.
webmaster@oreilly.com