Oracle 8i Admin
Oracle 8i Admin
Oracle 8i Admin
30051GC10
Production 1.0
August 1999
M09125
Enterprise DBA Part 3:
Network Administration
Student Guide
Author
Sharaaz Khan
Technical Contributors
and Reviewers
Peter Kilpatrick
Bruce Ernst
Hanne Rasmussen
A. J. Vos
Mary Bryksa
Joel Goodman
Andrew Philips
Alexander Hunold
Publisher
Tommy Cheung
Copyright Oracle Corporation, 1999. All rights reserved.
This documentation contains proprietary information of Oracle Corporation. It is
provided under a license agreement containing restrictions on use and disclosure
and is also protected by copyright law. Reverse engineering of the software is
prohibited. If this documentation is delivered to a U.S. Government Agency of the
Department of Defense, then it is delivered with Restricted Rights and the
following legend is applicable:
Restricted Rights Legend
Use, duplication or disclosure by the Government is subject to restrictions for
commercial computer software and shall be deemed to be Restricted Rights
software under Federal law, as set forth in subparagraph (c) (1) (ii) of DFARS
252.227-7013, Rights in Technical Data and Computer Software (October 1988).
This material or any portion of it may not be copied in any form or by any means
without the express prior written permission of Oracle Corporation. Any other
copying is a violation of copyright law and may result in civil and/or criminal
penalties.
If this documentation is delivered to a U.S. Government Agency not within the
Department of Defense, then it is delivered with Restricted Rights, as defined in
FAR 52.227-14, Rights in Data-General, including Alternate III (June 1987).
The information in this document is subject to change without notice. If you find
any problems in the documentation, please report them in writing to Education
Products, Oracle Corporation, 500 Oracle Parkway, Box SB-6, Redwood Shores,
CA 94065. Oracle Corporation does not warrant that this document is error-free.
Oracle is a registered trademark and trademarks or registered trademarks of
Oracle Corporation.
All other products or company names are used for identification purposes only
and may be trademarks of their respective owners.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration iii
.....................................................................................................................................................
Contents
Introduction
Course Objectives I-2
Database Administrator Tasks I-4
Course Schedule I-5
Lesson 1: Networking Overview
Objectives 1-2
Network Environment Challenges 1-3
Network Configurations 1-5
Oracles Solutions 1-8
Summary 1-20
Lesson 2: Basic Net8 Architecture
Objectives 2-2
Overview 2-3
Basic Operations 2-4
Files and Locations 2-5
The Net8 Stack 2-10
Summary 2-20
Lesson 3: Basic Net8 Server-Side Configuration
Objectives 3-2
Overview: The Listener Process 3-3
The Listener Responses 3-4
Bequeath Session 3-5
Redirect Session (Dedicated) 3-6
Redirect Session (Dispatcher) 3-7
The LISTENER.ORA File 3-9
LISTENER.ORA File Parameters 3-12
Listener Configuration: Creation 3-14
Listener Configuration: Services 3-15
Listener Control Utility (LSNRCTL) 3-16
LSNRCTL Commands 3-17
Additional LSNRCTL Commands 3-18
.....................................................................................................................................................
iv Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Contents
LSNRCTL SET and SHOW Modifiers 3-19
Automatic Instance Registration 3-21
Automatic Instance Registration: Parameters 3-22
Troubleshooting the Listener 3-23
Summary 3-25
Frequently Asked Questions 3-26
Lesson 4: Basic Net8 Client-Side Configuration
Objectives 4-2
Overview 4-3
Host Naming 4-4
Local Naming 4-6
Configuring Local Naming Using Net8 Assistant 4-7
Generated Files 4-16
New TNSNAMES.ORA Parameters 4-18
Connection Load Balancing 4-20
Connection Load Balancing and Failover: Example 4-22
Troubleshooting the Client Side 4-23
Summary 4-25
Frequently Asked Questions 4-26
Lesson 5: Centralized Naming Concepts
Objectives 5-2
What Is a Service Name? 5-3
Service Name Resolution Methods 5-4
Resolution with Local Naming 5-5
Resolution with Centralized Naming 5-6
Centralized Naming Using a Names Server 5-7
When to Use a Names Server 5-8
Oracle Names Directory Objects 5-9
Domain Naming Models: Flat 5-10
Domain Naming Models: Hierarchical 5-11
Names Server Dynamic Discovery 5-12
Client-Side Cache 5-13
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration v
.....................................................................................................................................................
Contents
Cache Replication 5-14
The Region Database 5-15
Summary 5-16
Lesson 6: Oracle Names Usage and Configuration
Objectives 6-2
Configuring Centralized Naming 6-3
Configuring the Names Server (Cache) 6-5
Configuring the Client Profile 6-11
Testing the Names Server 6-16
Configuring a Region Database 6-17
Names Control Utility (NAMESCTL) 6-20
NAMESCTL Commands 6-21
Other NAMESCTL Commands 6-24
NAMESCTL SET Modifier 6-26
NAMESCTL SHOW Modifier 6-27
Summary 6-29
Lesson 7: Multithreaded Server Usage and Configuration
Objectives 7-2
Server Configurations 7-3
Multithreaded Server Architecture 7-9
Configuring the Multithreaded Server 7-12
Data Dictionary 7-23
Connection Pooling 7-25
Summary 7-29
Lesson 8: Connection Manager Usage and Configuration
Objectives 8-2
Configuring Connection Manager 8-5
Summary 8-21
Lesson 9: Troubleshooting the Network Environment
Objectives 9-2
Overview 9-3
.....................................................................................................................................................
vi Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Contents
Troubleshooting Checklist 9-4
TNSPING Utility 9-6
Net8 Assistant: Logging and Tracing 9-7
Listener Audit Trail 9-14
Logging and Tracing Components 9-15
Trace Assistant 9-18
Summary 9-21
Frequently Asked Questions 9-22
Lesson 10: Security in the Network Environment
Objectives 10-2
Overview: Network Security Risks 10-3
Data Privacy: Data Theft 10-4
Data Integrity: Data Modification 10-5
Data Integrity: Data Disruption 10-6
Compromised Authentication 10-7
Compromised Authorization 10-8
Network Security Solutions 10-9
Data Encryption 10-10
Cryptographic Checksumming 10-11
Configuring Encryption and Checksumming 10-12
Encryption and Checksumming Modes 10-13
Authentication 10-14
Enhanced User Authentication 10-15
Token Cards 10-16
Biometric Authentication 10-17
Kerberos Authentication 10-18
RADIUS Authentication 10-19
Configuring Authentication 10-20
Single Sign-On 10-21
Secure Sockets Layer 10-22
DCE Integration 10-23
Summary 10-24
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration vii
.....................................................................................................................................................
Contents
Appendix A: Practices
Practice 3 A-2
Practice 4 A-3
Practice 6 A-4
Practice 7 A-6
Practice 8 A-7
Practice 9 A-8
Appendix B: Practice Solutions
Practice 3 Solutions B-2
Practice 4 Solutions B-6
Practice 6 Solutions B-12
Practice 7 Solutions B-18
Practice 8 Solutions B-22
Practice 9 Solutions B-26
Appendix C: Configuring External Procedures
Configuring External Procedures C-2
.....................................................................................................................................................
viii Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Contents
................................
I
Introduction
I-2 Enterprise DBA Part 3: Network Administration
......................................................................................................................................................
......................................................................................................................................................
Introduction
Course Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
At the end of this course, you should be able to do
the following:
Identify network trends and problems, and provide
solutions for them
Define the Net8 architectural layers
Configure a simple client and server, and establish
a connection between them
Configure and start a Names server and use it to
resolve a service name
Enterprise DBA Part 3: Network Administration I-3
......................................................................................................................................................
......................................................................................................................................................
Course Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
Configure and start up a multithreaded server
Configure the Connection Manager and use it for
pooling connections and restricting clients from
connecting
Analyze and troubleshoot Net8 problems using log
files, trace files, and Trace Assistant
Identify network security risks and their solutions
and configure data encryption using the Oracle
Advanced Security option
I-4 Enterprise DBA Part 3: Network Administration
......................................................................................................................................................
......................................................................................................................................................
Introduction
Database Administrator Tasks
Scope of the Course
This course is the fourth in a series of four courses that cover the core database
administrator tasks. The tasks covered in this course are:
Planning the network environment to address connectivity, performance,
and security issues
Enabling network client-server, server-server, and middle-tier
connectivity
Managing the network through administration utilities and tools
Ensuring solid network integrity, privacy, authentication, and
authorization
Invoking the tools needed for troubleshooting the network environment
DBA Tasks Covered in Other Courses
The following tasks are discussed in other courses:
Database administration in Enterprise DBA Part 1A: Architecture and
Administration
Backup and recovery in Enterprise DBA Part 1B: Backup and Recovery
Database tuning in Enterprise DBA Part 2: Performance and Tuning
Copyright Oracle Corporation, 1999. All rights reserved.
Database Administrator Tasks
Planning the network environment
Enabling connectivity
Managing the network
Ensuring network security
Troubleshooting the network
Database administration
Backup and recovery
Database tuning
Enterprise DBA Part 3: Network Administration I-5
......................................................................................................................................................
......................................................................................................................................................
Course Schedule
Course Schedule
Agenda
The following is the recommended lesson schedule for this course:
Day 1
Networking Overview
Basic Net8 Architecture
Basic Net8 Server-Side Configuration
Basic Net8 Client-Side Configuration
Centralized Naming Concepts
Oracle Names Usage and Configuration (Theory)
Day 2
Oracle Names Usage and Configuration (Practice)
Multithreaded Server Usage and Configuration
Connection Manager Usage and Configuration
Troubleshooting the Network Environment
Security in the Network Environment
Copyright Oracle Corporation, 1999. All rights reserved.
Suggested Course Schedule
Day Start End
1 Lesson 1 Lesson 5
2 Lesson 6 Lesson 10
I-6 Enterprise DBA Part 3: Network Administration
......................................................................................................................................................
......................................................................................................................................................
Introduction
.................................
1
Networking Overview
.....................................................................................................................................................
1-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 1: Networking Overview
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Identify networking business trends
Describe Oracle networking solutions
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 1-3
.....................................................................................................................................................
Network Environment Challenges
Network Environment Challenges
Configuring the Network Environment
To implement a successful networking environment consider the following questions:
What type of network are you configuring? Is it a small network with a few clients,
or a more complex network with many clients and many servers?
Are you using a single protocol or multiple protocols?
Is the network static or expanding?
What configuration options do you have?
Are there user-friendly tools available to configure the network?
Maintaining the Network
How much network maintenance is required for your enterprise?
Will you add clients and servers to your network?
Do you anticipate frequent upgrades?
Tuning, Troubleshooting, and Monitoring the Network
Does your network include the needed tools?
How large a workload do you anticipate?
Number of users
Number of transactions
Number of nodes
Location of nodes
Copyright Oracle Corporation, 1999. All rights reserved.
Complex Network
TCP/IP
AppleTalk
SPX/IPX
NetBIOS
DECnet
APPC/LU6.2
.....................................................................................................................................................
1-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 1: Networking Overview
Oracles Solutions
Copyright Oracle Corporation, 1999. All rights reserved.
Oracles Solutions
Net8
Oracle Names server
Connection Manager
Advanced Security option
Open Gateways
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 1-9
.....................................................................................................................................................
Oracles Solutions
Net8 Key Features
Net8 introduces key new features to address the changes occurring from the growth in
distributed environments. These changes include increasing user access to data stores,
creating more easily configured and administered environments, and enhancing user
authentication to securely identify users.
Copyright Oracle Corporation, 1999. All rights reserved.
Oracles Solutions:
Connection Manager
Connection Manager offers:
Multiplexing of connections
Cross-protocol connectivity
Network access control
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 1-15
.....................................................................................................................................................
Oracles Solutions
Connection Multiplexing
This example shows how Connection Manager acts as a multiplexer to funnel data
from many clients to one server.
1 The initial connection from a client to a server is established by connecting to
Connection Manager.
2 Connection Manager establishes the connection to the server.
3 When additional clients are request connections to the server through Connection
Manager, they use the same connection that Connection Manager used for the
initial connection.
Copyright Oracle Corporation, 1999. All rights reserved.
Oracles Solutions:
Connection Manager
Server
Connection
Manager
1
2
3
.....................................................................................................................................................
1-16 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 1: Networking Overview
Oracle Advanced Security Option
Oracle Advanced Security option is an optional product that works with Net8 and
SQL*Net release 2.3.4 and later SQL*Net versions. It includes the following features:
Security Services With the Oracle Advanced Security option, Net8 and related
products can use network data encryption and checksumming so that data cannot be
read or altered during transmission.
Authentication Services Oracle Advanced Security option includes enhanced user
authentication services such as support for single sign-on. No changes to applications
are required. Oracle Advanced Security option works over all protocols, operating
systems, and name services. It supports token authentication through Security
Dynamics ACE Server, Kerberos, DCE Security Server, and supports biometrics
authentication through Identix. With Oracle8i, authentication is also supported
through RADIUS with services by Lucent, ActivCard, Funk, and Secure Computing.
X.509 Certificates are also supported with Oracle8i.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
Net8 includes:
Net8
IIOP and HTTP Connectivity
Oracle Names
Connection Manager
Add-on products:
Advanced Security Option
Gateways
.................................
2
Basic Net8 Architecture
.....................................................................................................................................................
2-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 2: Basic Net8 Architecture
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Define the procedure by which Net8 establishes a
server connection
Identify the key components of Net8 architecture
and their interaction
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-3
.....................................................................................................................................................
Overview
Overview
Copyright Oracle Corporation, 1999. All rights reserved.
Overview
Net8 provides three basic functions:
Connect operations
Data operations
Exception operations
The Net8 architecture comprises several layers, each
of which has a unique responsibility in a networking
session.
.....................................................................................................................................................
2-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 2: Basic Net8 Architecture
Basic Operations
Connecting to a Server (Open)
The following procedure is true for all connections and is illustrated in the slide
example.
1 In order for a client to connect to a server, a process needs to be listening for
incoming requests on the server side. The listener process is responsible for
detecting and routing the incoming requests to the proper destination.
To start a listener process, a configuration file located on the server side typically
must be configured.
2 A user or program resolves the service name to a connection string. A service
name is an alias for a destination address.
The service name directly maps to a connect descriptor, which is resolved through
one of the following methods (described fully in later lessons):
Host naming (using the sqlnet.ora file and a native naming service)
Local naming (using the tnsnames.ora file)
Oracle Names (using the sqlnet.ora file and an Oracle Names server)
3 When the service name is resolved, a request is sent to the listener. The listener
receives the session request and determines where to direct the request.
4 The listener spawns a new process or redirects the connection to an existing
process that handles the communication with the Oracle database.
5 The address of the process is handed off to the client-side process, and the client
side directly communicates with the server-side process for the duration of the
session without involving the listener.
Copyright Oracle Corporation, 1999. All rights reserved.
Connecting to Servers
Client Server
1
listener.ora
Listener
sqlplus user/pw@DB1
User
DB1 address resolved
2
3
4
Server
5
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-5
.....................................................................................................................................................
Files and Locations
Files and Locations
Files
tnsnames.ora This configuration file contains the names and addresses of
services on the network. It is used by both clients and distributed servers to identify
destination servers.
sqlnet.ora This file is used by all clients and servers on the network. It contains
client profile information, including optional diagnostic parameters, client information
about Oracle Names (if used), and other optional parameters such as native naming
and security.
listener.ora This file contains configuration information for the listener
located on the machine that you want to connect to. The listener is an executable
program that enables an Oracle8 Server to accept connections from client machines
over Net8.
Copyright Oracle Corporation, 1999. All rights reserved.
Net8 Architecture
Server
Protocol
OPA
Two Task
Common
OPI
Server
TNS
Client
Two Task
Common
OCI
Application
TNS
Protocol
OPA
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-11
.....................................................................................................................................................
The Net8 Stack
Application Layer
Oracle client applications provide all user-oriented activities, such as character or
graphical user interface (GUI) display, screen control, data presentation, application
flow, and other application specifics.
An example of a client application could be Oracle Forms or SQL*Plus.
The application identifies database operations to send to the server and passes them
through to the Oracle Call Interface (OCI).
Copyright Oracle Corporation, 1999. All rights reserved.
Application Layer
User-oriented activities:
Character or graphical user
interface
Data presentation
Application specifics
Identification of database
operations
Client
Application
.....................................................................................................................................................
2-12 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 2: Basic Net8 Architecture
Oracle Call Interface Layer
The OCI code contains all the information required to initiate a SQL dialogue between
the client and the server. It defines calls to the server to:
Describe the contents of the fields being returned based on the values in the
servers data dictionary
Parse SQL statements for syntax validation
Open a cursor for the SQL statement
Bind client application variables into the server shared memory
Execute SQL statements within the cursor memory space
Fetch one or more rows of data into the client application
Close the cursor
The OCI is also referred to as the OPI, or Oracle Program Interface, on the server. The
client application uses a combination of these calls to request activity within the
server. OCI calls can be combined into a single message to the server, or they can be
processed one at a time through multiple messages to the server, depending on the
nature of the client application. Oracle products attempt to minimize the number of
messages sent to the server by combining many OCI calls into a single message to the
server. When a call is sent, control is passed to Net8 to establish the connection and
transmit the request to the server.
Technical Note
The OCI is fully documented, so anyone who wants to write applications using OCI
can do so.
Copyright Oracle Corporation, 1999. All rights reserved.
OCI
OCI Layer
Oracle Call Interface:
Defines server calls
Parses SQL statements
Opens cursors
Binds variables
Executes SQL
Fetches data
Closes cursors
Client
Application
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-13
.....................................................................................................................................................
The Net8 Stack
Two Task Common Layer
The Two Task Common layer provides character set and data type conversion between
different character sets or formats on the client and server. This layer is optimized to
perform conversion only when required on a per-connection basis.
During the initial connection, the Two Task Common layer is responsible for
evaluating differences in internal data and character set representations and
determining whether conversions are required for the two computers to communicate.
Conversion is required in situations in which the client-side character set differs from
that of the server side.
One example of this situation is a client running the WE8ISO8859P1 character set
while the server is running the US7ASCII character set. In this case, the Two Task
Common layer acts as a translator, helping to convert the values of one character set to
the other.
Copyright Oracle Corporation, 1999. All rights reserved.
TNS Layer
Transparent Network Substrate:
Provides generic interface to
industry-standard protocols
Consists of more Net8 specific
layers
Client
Two Task
Common
OCI
Application
TNS
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-15
.....................................................................................................................................................
The Net8 Stack
Oracle Protocol Adapter Layer
Oracle protocol adapters (OPA) are responsible for mapping TNS functions to
industry-standard protocols used in the client-server connection. Each adapter is
responsible for mapping the equivalent functions between TNS and a specific
protocol.
Network Protocols
The Net8 architecture provides support for a broad range of networking protocols,
including TCP/IP, Novell SPX/IPX, IBM LU6.2, DECnet, and OSI. By using Net8
protocol adapters, companies can maintain their existing infrastructure without
expensive changes. Additionally, Net8 supports multiple protocols on a single
machine simply through installation of multiple protocol adapters.
Copyright Oracle Corporation, 1999. All rights reserved.
Protocol
Client
Two Task
Common
OCI
Application
TNS
Protocol
OPA
Network Protocol:
Existing network protocol for
machine-level connectivity
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-17
.....................................................................................................................................................
The Net8 Stack
Oracle Program Interface Layer
The OPI performs a complementary function to that of the OCI. It is responsible for
responding to each of the possible messages sent by the OCI. For example, an OCI
request to fetch 25 rows would have an OPI response to return the 25 rows after they
have been fetched.
Copyright Oracle Corporation, 1999. All rights reserved.
OPI Layer
Server
OPI
Oracle Program Interface:
Responds to each OCI call made by
the client side
Protocol
OPA
TNS
Two Task
Common
Same functions as on the client side
.....................................................................................................................................................
2-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 2: Basic Net8 Architecture
Server Layer
The Oracle server side of the connection is responsible for receiving requests from the
client OCI code and resolving SQL statements on behalf of the client application.
Once received, a request is processed and the resulting data is passed to the OPI for
responses to be formatted and returned to the client application.
Copyright Oracle Corporation, 1999. All rights reserved.
Server Layer
Server
Protocol
OPA
TNS
Two Task
Common
OPI
Server
Oracle Server:
Responsible for receiving OCI calls
from the client and resolving SQL
statements on behalf of the client
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 2-19
.....................................................................................................................................................
The Net8 Stack
Network Program Interface Layer
When two servers communicate to complete a distributed transaction, the process and
layers are the same as in the client-server scenario, except that there is no client
application. The server has its own version of OCI, called the Network Program
Interface (NPI). The NPI performs all of the functions for the server that the OCI does
for clients, enabling a coordinating server to construct SQL requests for additional
servers.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
In the Net8 stack, each layer has a specific task.
Users must install the appropriate protocol
adapter in order for a client to communicate with a
server using Net8 software.
.................................
3
Basic Net8 Server-Side
Configuration
.....................................................................................................................................................
3-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 3: Basic Net8 Server-Side Configuration
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Configure the listener using the Net8 Assistant
Start the Net8 listener using the Listener Control
utility (LSNRCTL)
Stop the Net8 listener using LSNRCTL
Identify additional LSNRCTL commands
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 3-3
.....................................................................................................................................................
Overview: The Listener Process
Overview: The Listener Process
Characteristics of the Listener Process
The listener is a process running on a node that listens for incoming connections on
behalf of a database or a number of databases. The following are the characteristics of
a listener:
A listener process can listen for more than one database.
Multiple listeners can listen on behalf of a single database to perform load
balancing.
The listener can listen on multiple protocols.
The default name of the listener in Net8 is LISTENER.
The name of the listener must be unique on the machine on which it resides, and
per listener.ora file.
Copyright Oracle Corporation, 1999. All rights reserved.
Bequeath Session
1
2
3
Spawned
server
process
4
5
listener
port
1521
Client
Server
.....................................................................................................................................................
3-6 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 3: Basic Net8 Server-Side Configuration
Redirect Session (Dedicated)
Redirect Session (Prespawned)
The use of prespawned dedicated server processes requires specification in a listener
configuration file (listener.ora).
Steps in a Redirect Session (Prespawned Dedicated Server Process)
In a prespawned dedicated server, the listener redirects the session to a prespawned
server process, rather than spawns the process as in the bequeathed connection.
1 The listener spawns a series of dedicated server processes when it is started.
Note: The maximum number of server processes are defined by the
PRESPAWN_MAX parameter in the listener configuration file
(listener.ora). The listener stops spawning additional servers once the
PRESPAWN_MAX has reached. The listener maintains a log of the number of
prespawned servers and the servers that are in use by various clients.
2 A client connects to the listener with the network address.
3 The listener receives the session request and determines if the clients request may
be serviced. If not, the listener refuses the session and then continues listening.
4 The listener issues a Redirect message to the client containing the network address
of one of the prespawned servers.
5 The client disconnects from the listener and connects to the prespawned address
given by the listener.
6 Once the session is established, the listener spawns another server to replace the
one used by the client.
7 The listener continues listening for incoming sessions.
Prespawned servers take up system resources, but the connection time from the client
to the server process is faster than in the Bequeath method.
Copyright Oracle Corporation, 1999. All rights reserved.
LSNRCTL Commands
The following functions are mostly used to control
the listener:
Starting a listener
Stopping the listener
.....................................................................................................................................................
3-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 3: Basic Net8 Server-Side Configuration
Additional LSNRCTL Commands
Other LSNRCTL Commands
Command Description
CHANGE_PASSWORD Dynamically changes the encrypted password of a
listener.
EXIT Quits the LSNRCTL utility.
HELP Provides the list of all available LSNRCTL
commands.
QUIT Provides the functionality of the EXIT
command.
RELOAD Shuts down everything except listener addresses and
rereads the listener.ora file. You use this
command to add or change services without actually
stopping the listener.
SAVE_CONFIG Creates a backup of your listener configuration file
(called listener.bak) and updates the
listener.ora file itself to reflect any changes.
SERVICES Provides detailed information about the services the
listener listens for.
SET parameter This command sets a listener parameter.
SHOW parameter This command lists the value of a listener parameter.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
The listener process listens for incoming
connections and services a connection either by
passing it to a server process or redirecting it.
The listener.ora file is the configuration file for
the listener.
The Listener Control utility controls the functions
of the listener.
The listener.ora file can be configured for more
than one listener.
.....................................................................................................................................................
3-26 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 3: Basic Net8 Server-Side Configuration
Frequently Asked Questions
The following discussion points are taken from the frequently asked questions
regarding topics in this chapter. This information is retrieved and analyzed in
cooperation with Oracle Worldwide Support.
Problem
How do you register a unique client identifier with the Net8 listener?
Solution
To register a unique client identifier with the listener during a connection request and
to include it in an audit trail, edit the sqlnet.ora file. Use any alphanumeric string
up to 128 characters long to specify the value of the
SQLNET.CLIENT_REGISTRATION parameter in the clients sqlnet.ora file.
Net8 sets the SQLNET.CLIENT_REGISTRATION to OFF by default.
Problem
When starting a Net8 TNS listener in UNIX, the following error occurs:
01151, 00000, "Missing listener name, %s, in
LISTENER.ORA"
// *Cause: The listener could not find the listener
name specified.
// *Action: Make sure valid addresses on which to
listen are specified // for
the listener name in LISTENER.ORA.
Solution
If the listener.ora file is correct and it was working before, then check the
environment for the Oracle account that starts the listener. Check the environment
variables for $ORACLE_HOME, $ORACLE_SID, $PATH, and so on. Even if you set
these variables from a script, check them at the UNIX prompt:
env | more
.................................
4
Basic Net8 Client-Side
Configuration
.....................................................................................................................................................
4-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Establish a connection from the Net8 client side
using the host naming method
Configure Net8 client-side files and connect using
the local naming method
Use Net8 Assistant to define preferences on the
client side
Configure the Net8 client to use the client load
balancing and failover feature
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 4-3
.....................................................................................................................................................
Overview
Overview
Host Naming Method
Requires minimal user configuration. The user can provide only the name of the
host to establish a connection.
Eliminates the need to create and maintain a local names configuration file
(tnsnames.ora).
Eliminates the need to understand Oracle Names administration procedures.
Local Naming Method
Provides a relatively straightforward method for resolving service name addresses.
Resolves service names across networks running different protocols.
Copyright Oracle Corporation, 1999. All rights reserved.
Overview
The host naming method requires minimal
configuration; however, some requirements must
be met.
The local naming method requires configuration
using Net8 Assistant, a GUI tool.
.....................................................................................................................................................
4-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
Host Naming
Client-Side Requirements
If you are using the host naming method, you must have TCP/IP installed on your
client machine. In addition you must install Net8 and the TCP/IP protocol adaptor.
The host name is resolved through an IP address translation mechanism such as
Domain Name Services (DNS), Network Information Services (NIS), or a centrally
maintained TCP/IP host file: that means that this should be configured from the client
side before attempting to use the host naming method.
The Oracle Connection Manager features are not supported through the host naming
method.
Copyright Oracle Corporation, 1999. All rights reserved.
Local Naming
listener.ora
Server Client
tnsnames.ora
sqlnet.ora
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 4-7
.....................................................................................................................................................
Configuring Local Naming Using Net8 Assistant
Configuring Local Naming Using Net8 Assistant
Configuring Local Naming
You can use Net8 Assistant to configure local naming. This method configures
the client-side files tnsnames.ora and sqlnet.ora.
Because Net8 Assistant is implemented in Java and is packed with the Java Runtime
Environment, you can run it on any platform where Net8 is installed.
Starting Net8 Assistant from NT
From the NT menu bar, select Start>Programs>Oracle for NT>
Oracle Net8 Assistant.
In Oracle8i for NT, select Start>Programs>Oracle>
Network Administration>Net8 Assistant.
If you want to start Net8 Assistant from a file manager, the name of the
executable file is n8a.exe.
Starting Up Net8 Assistant on UNIX
Run the executable file, net8asst.sh.
Copyright Oracle Corporation, 1999. All rights reserved.
Net8 Assistant
.....................................................................................................................................................
4-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
Configuring the Profile
To configure local naming, make sure that the TNSNAMES method is part of your
selected method in Net8 Assistant. The TNSNAMES method enables local naming,
and this information is stored in the sqlnet.ora file.
If you have multiple methods listed in your selected methods, then order them
according to the method that you want Net8 to try first when resolving a service name.
The default installation provides the TNSNAMES and HOSTNAME methods.
In addition to the TNSNAMES and HOSTNAME methods, you can also choose:
ONAMES: Oracle Names, which allows service names to be resolved centrally
through a name server (This is covered in a later lesson.)
The following external naming services must be available from an operating system
level before you can configure from Net8 Assistant:
CDS: Cell Directory Services, which is available with the Advanced
Networking Option. This is also the choice for DCE.
NDS: Netware Directory Service is available for NetWare 4.1 or later.
NIS: Network Information Service is used on many UNIX servers.
Copyright Oracle Corporation, 1999. All rights reserved.
TNSNAMES.ORA
# TNSNAMES.ORA Configuration file:
C:\ORANT8\NET80\ADMIN\tnsnames.ora
# Generated by Oracle Net8 Assistant
TST8.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)(HOST = wwed151-sun)(PORT = 1521)
)
(CONNECT_DATA = (SID = TST8)
)
)
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 4-17
.....................................................................................................................................................
Generated Files
The SQLNET.ORA File
The sqlnet.ora file is also generated from the Net8 Assistant.
The default location is $ORACLE_HOME/network/admin on UNIX and
ORACLE_HOME\network\admin on NT, or what is defined in the TNS_ADMIN
environment variable.
For now, make sure the connection method you want to use is present and in the
correct order. The other arguments are covered in another lesson. Once the service
name has been configured and tested successfully, you can connect to the server from
the client using any Oracle tool.
Copyright Oracle Corporation, 1999. All rights reserved.
SQLNET.ORA
# C:\ORANT8\NET80\ADMIN\SQLNET.ORA Configuration
File:C:\ORANT8\NET80\ADMIN\sqlnet.ora
# Generated by Oracle Net8 Assistant
NAME.DEFAULT_ZONE=world
NAMES.DEFAULT_DOMAIN=world
SQLNET.AUTHENTICATION_SERVICES= (NTS)
SQLNET.EXPIRE_TIME=0
SQLNET.ENCRYPTION_SERVER=requested
SQLNET.ENCRYPTION_CLIENT=requested
NAMES.DIRECTORY_PATH= (TNSNAMES, HOSTNAME)
sqlplus system/manager@TST8
.....................................................................................................................................................
4-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
New TNSNAMES.ORA Parameters
Multiple Instances and Databases
In Oracle8i, a service can include multiple services provided by a single database and
services that span multiple instances. In earlier releases, the SID identified a database
instance, but it did not identify a database. Because of this a database could not have
more than one service associated with it.
A database can serve multiple instances, and the SID parameter in the connect
descriptor has been replaced by SERVICE_NAME and INSTANCE_NAME.
The SERVICE_NAME is typically set to the global database name, which consists of
the database name and the domain name. The parameter INSTANCE_NAME is
required only for a parallel server configuration.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
The host naming method requires no setup in a
TCP/IP environment if defaults are acceptable.
The local naming method uses the tnsnames.ora
file.
.....................................................................................................................................................
4-26 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
Frequently Asked Questions
The following discussion points are taken from the most frequently asked questions
regarding topics in this chapter. This information is retrieved and analyzed in
cooperation with Oracle Worldwide Support.
Problem
After you upgrade to Oracle8 and upgrade clients to Net8, the following error occurs
when you try to connect through SQL*Plus:
06413, 00000, Connection not open.
// *Cause: Unable to establish connection.
// *Action: Use diagnostic procedures to ascertain exact
problem.
Solution
Verify that SQL*Net 2.x and Net8 are not in the same directory. Both of these cannot
be installed in the same directory and share tools.
Problem
How to disable out of band breaks using Net8.
Solution
To disable out of band breaks, set the DISABLE_OOB parameter to ON in the clients
sqlnet.ora file. Net8 sets the DISABLE_OOB to OFF by default.
Problem
When you attempt to connect to an Oracle8 database in loopback mode (a connection
from the same machine to the same machine, acting as the client and the server as
well) using Net8, the following error occurs:
ORA-06401: NETCMN: invalid driver designator.
The loopback is attempted by using either of the following two strings:
sqlplus system/manager@2:
sqlplus system/manager@2:orcl
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 4-27
.....................................................................................................................................................
Frequently Asked Questions
Solution
The 2: and 2:orcl (2:sid) connection strings for local connections to Oracle8 are not
supported. Instead, use the default connection string for a local connection through the
Bequeath protocol adapter. By default, tnsnames.ora contains the following alias
for the bequeath protocol adapter:
Beq-local.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = BEQ)
(PROGRAM = oracle80)
(ARGV0 = oracle80ORCL)
(ARGS = (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=BEQ))))
)
(CONNECT_DATA = (SID = ORCL))
)
Note: When the PROTOCOL parameter is defined with the BEQ variable, any
connection made to service name will use an internal protocol called Bequeath. The
Bequeath protocol internally spawns a server thread for each client application. In a
sense, it performs the same operation that a remote network listener does for your
connection, yet locally.
.....................................................................................................................................................
4-28 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 4: Basic Net8 Client-Side Configuration
.................................
5
Centralized Naming
Concepts
.....................................................................................................................................................
5-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 5: Centralized Naming Concepts
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Define the Names server concept
Identify the various names resolution methods
Identify the benefits of a Names server
Define the administration objects used in a Names
server environment
Define the naming models
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 5-3
.....................................................................................................................................................
What Is a Service Name?
What Is a Service Name?
Service Names
A service name is an alias for a logical representation of a service, such as a database.
It is used to resolve complicated connection strings used to connect to a service. It is
the way a database or other service is presented to clients. A service name could be
any one of the following examples:
SALES could be created to match the database name (Oracle8i)
SALES1 could be an instance of the SALES database
HR could be created to match the name of the personnel system
FINANCE could be created to match the name of the finance system
With Net8, you can connect to services other than Oracle databases, such as non-
Oracle databases, gateways, and external procedures, and functions that can be called
from PL/SQL code.
Copyright Oracle Corporation, 1999. All rights reserved.
Server
Names server
1
2
3
4
Centralized Naming Using a Names
Server
Client
.....................................................................................................................................................
5-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 5: Centralized Naming Concepts
When to Use a Names Server
Copyright Oracle Corporation, 1999. All rights reserved.
NAMESCTL> reorder_ns
NAMESCTL> reorder_ns
PING
PING
PING
0.07 sec.
0.03 sec.
0.05 sec.
Names List File
Names server 1
Names server 3
Names server 2
Client-Side Cache
Client
Server 2
Cache
1
2
Server TTL
Server 1 0.00
Server 3 2.3
Server 2 10.00
Server TTL
Server 1 0.00
Server 3 2.3
Server 2 10.00
3
.....................................................................................................................................................
5-14 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 5: Centralized Naming Concepts
Cache Replication
Cache Replication
Data in Oracle Names servers is updated through continuous replication among all the
Oracle Names servers in the region, or by writing to and reading from a common
Oracle database.
For smaller workgroup environments where all of the services are registered
dynamically, administrators can configure Oracle Names servers to replicate data
continuously among themselves. When a listener registers a new service, information
about that service will immediately be passed along to other Oracle Names servers in
the administrative region. In this way, service names and addresses are replicated
among other Names servers in the network.
In larger networks, it is safer and more efficient to use a region database. Cache
replication is best suited for networks with just a few Names servers.
Cache replication occurs, by default, when a region database is not defined.
Copyright Oracle Corporation, 1999. All rights reserved.
Cache Replication
Names server
Names server
Names server
Names server
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 5-15
.....................................................................................................................................................
The Region Database
The Region Database
Using a Region Database
Administrators in large environments normally store their service name in an Oracle
database, rather than have the service names replicated between Names servers (as in
Cache replication).
If Names servers are configured to use an Oracle database as a repository, all
registered service names are written to the database. Additional Names servers in a
given administrative region periodically poll the region database for updated service
names.
In this way, new service name are communicated in a timely manner to all of the
Oracle Names servers in a given region. At the same time, it relieves Names servers of
the necessity to communicate directly with each other, as well as provides better
reliability.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
Local naming uses the TNSNAMES.ORA file to
resolve a service name.
Host naming uses default system settings.
Centralized naming uses the Names server to
resolve service names.
Use a Names server when the network
environment is distributed and dynamic.
A region database is used in conjunction with a
Names server to store the service names.
.................................
6
Oracle Names Usage and
Configuration
.....................................................................................................................................................
6-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 6: Oracle Names Usage and Configuration
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Configure centralized naming using Net8 Assistant
Store the network configuration in the client cache
Store the network configuration in a region
database
Start and stop the Names server using the Names
Control utility
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 6-3
.....................................................................................................................................................
Configuring Centralized Naming
Configuring Centralized Naming
Copyright Oracle Corporation, 1999. All rights reserved.
NAMESCTL Commands
The following functions are available for the
NAMESCTL utility:
Starting a Names server
Stopping a Names server
Viewing the status of a Names server
.....................................................................................................................................................
6-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 6: Oracle Names Usage and Configuration
Example of the Status Output
NAMESCTL> Status
Server name: onames_wwed110-pc
Server has been running for: 1 hour 30 minutes 11.42
seconds
Request processing enabled: yes
Request forwarding enabled: yes
Requests received: 5
Requests forwarded: 0
Foreign data items cached: 0
Region data next checked for reload in: not set
Region data reload check failures: 0
Cache next checkpointed in: not set
Cache checkpoint interval: not set
Cache checkpoint file name:
C:\ORANT\NETWORK\names\ckpcch.ora
Statistic counters next reset in: not set
Statistic counter reset interval: not set
Statistic counters next logged in: not set
Statistic counter logging interval: not set
Trace level: 0
Trace file name:
C:\ORANT\NETWORK\trace\names83.trc
Log file name:
C:\ORANT\NETWORK\log\names.log
System parameter file name:
C:\ORANT\NETWORK\admin\names.ora
Command-line parameter file name: ""
Administrative region name: ""
Administrative region description: ""
ApplTable Index: 0
Contact ""
Operational Status 0
Save Config on Stop no
NAMESCTL>
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 6-23
.....................................................................................................................................................
NAMESCTL Commands
Testing a Names Server
To test if a Names server is up and running, the PING command is used. This
command returns the time it takes to contact a Names server and an acknowledgment.
The following is an example of the PING command attempting to test the default
Names server:
NAMESCTL> ping nserver1.oracle.com
roundtrip time is 0.02 seconds
Discovering Names Servers
The REORDER_NS command creates the file that lists local Names servers and their
addresses. It does this by using the Names server discovery process described earlier.
NAMESCTL> reorder_ns
Starting the Client Cache Process
The START_CLIENT_CACHE command starts the client cache daemon process. The
client cache daemon process must be stopped before this command is issued, and a
Names server list must exist. The Names server list is created with the REORDER_NS
command.
NAMESCTL> start_client_cache
Copyright Oracle Corporation, 1999. All rights reserved.
NAMESCTL Commands
Testing a Names server
Discovering Names servers
Starting the client cache process
.....................................................................................................................................................
6-24 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 6: Oracle Names Usage and Configuration
Other NAMESCTL Commands
Other NAMESCTL Commands
DELEGATE_DOMAIN: Defines a domain as the start of a subregion of the
current region.
DOMAIN_HINT: Provides the Names servers in the current region with
the name and address of a Names server in another region.
EXIT: Closes the NAMESCTL utility.
FLUSH: Drops all stored nonauthoritative data from the Names server
cache.
FLUSH_NAME: Drops one or more specific nonauthoritative names
from the cache of the current Names server.
HELP: Provides details about the NAMESCTL command.
LOG_STATS: Logs the current set of Names server statistics to the
configured log file for that Names server.
Note: Further details on the syntax and examples of these commands can be found in
Appendix A of Net8 Administrators Guide.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
A Names server is a centrally located service by
which service names are resolved to connect
strings.
names.ora is the configuration file for the Names
server.
The Names server can be configured by either
manually modifying the names.ora file or by using
Net8 Assistant.
.....................................................................................................................................................
6-30 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 6: Oracle Names Usage and Configuration
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
NAMESCTL is the utility used to configure the
Names server.
A region database is a database repository of
service names stored by the Names server.
The NAMESCTL SET and SHOW modifiers are
used to change and display the settings of the
Names server, respectively.
.................................
7
Multithreaded Server
Usage and Configuration
.....................................................................................................................................................
7-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Identify the components of the multithreaded
server (MTS)
Configure dispatchers using init.ora
Configure shared servers using init.ora
Specify the listener address for multithreaded
server
Set up connection pooling using the multithreaded
server
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-3
.....................................................................................................................................................
Server Configurations
Server Configurations
Oracle Server Configuration Options
The Oracle8 and Oracle8i Servers can be configured in different ways to vary the
number of user processes per server process.
You can configure the servers in three possible combinations:
Combined User and Server Processes The user and server processes are combined
into a single user process. This is also known as single-task architecture. This
configuration is only allowed on certain platforms.
Oracle with Dedicated Servers A dedicated server process handles requests for a
single user process. This is also known as two-task architecture.
Oracle with Multithreaded Servers With a multithreaded server, a dispatcher
process enables many user processes to share a few server processes. This is also
known as a multithreaded server (MTS) configuration.
Copyright Oracle Corporation, 1999. All rights reserved.
Server Configurations
Combined user and server processes (single-task)
Dedicated server (two-task)
Multithreaded server
.....................................................................................................................................................
7-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
Single-Task Oracle
When one process executes both the application code and the Oracle code, this
configuration is called single-task Oracle.
Single-Task Processes
The operating system must be able to maintain separation of the application code
and the Oracle code to prevent the application code from damaging the Oracle
code. An example of an operating system that can maintain this separation is Open
VMS.
In contrast, UNIX cannot provide this separation and so must have separate
processes to run the application code and the Oracle code.
The process executing the application code is also called the user process. A
process can make only one Oracle connection at any time, except in an SQL*Net
environment where multiple connections can be maintained.
Copyright Oracle Corporation, 1999. All rights reserved.
User process
Combined User and Server Process
(Single-Task)
PMON DBWR SMON LGWR CKPT ARCH
Server
code
Application
code
Instance
SGA
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-5
.....................................................................................................................................................
Server Configurations
Two-Task Oracle
If the user and server processes are separate, the term two-task is used. In two-task
Oracle, the servers can be shared or dedicated. Two-task simply means the database
application code and the Oracle code are executed by different processes.
Dedicated Server Processes
The user process and server process are separate.
Each user process has its own server process.
The user and server processes can run on different machines to take advantage of
distributed processing.
There is a one-to-one ratio between the user and server processes.
Even when the user process is not making a database request, the dedicated server
exists but remains idle.
The dedicated server process is sometimes referred to as a shadow process,
because it is acting on behalf of one user process only.
The example shown is also applicable if the user process and server process are
running on the same machine in two-task mode, as with UNIX.
The program interface in use here depends on whether the user and the dedicated
server processes are on the same machine. If they are, the host operating systems
interprocess communication mechanism is used for the program interface between
processes.
Copyright Oracle Corporation, 1999. All rights reserved.
Multithreaded Server
Shared server
processes
Database server
client
Snnn
Snnn
User
process
User
process
Snnn
Instance
SGA
Dispatcher
D003
Dispatcher
D001
Dispatcher
D002
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-7
.....................................................................................................................................................
Server Configurations
Using Multithreaded Server
Server processes are shared among user processes.
A user can still request a dedicated server.
MTS architecture reduces memory usage by reducing the number of server processes
required. For example, for 100 users, 100 server processes are needed for dedicated
server connections. With MTS, you may need only 10 shared server processes for the
100 users.
Copyright Oracle Corporation, 1999. All rights reserved.
Multithreaded Server
Reduces the number of processes against an
instance
Increases the number of possible users
Achieves load balancing
Reduces the number of idle server processes
Reduces memory usage and system overhead
.....................................................................................................................................................
7-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
When to Use a Dedicated Server
Submitting batch jobs (it is expected that there will be little or no idle time)
Connecting with Server Manager to start up, shut down, or perform recovery
Connecting as internal
Technical Note
For most platforms, if your machine has plenty of memory to support dedicated
servers, you should use that configuration. In this situation, performance is likely to be
better.
There are exceptions such as NT, in which performance may improve using the
multithreaded server configuration due to the asynchronous nature of MTS.
To request a dedicated server, the clause SERVER=DEDICATED must be included in
the SQL*Net TNS connection string within the tnsnames.ora file:
TST8i.world =
(DESCRIPTION =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = wwed151-sun)
(PORT = 1521)
)
(CONNECT_DATA = (SID = TST8i)
(SERVER=DEDICATED)
)
)
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-9
.....................................................................................................................................................
Multithreaded Server Architecture
Multithreaded Server Architecture
Connecting to the Multithreaded Server
1 The listener process waits for any connection requests from a user process.
When a process requests a connection, the listener determines whether to connect
the user process a dispatcher (depending on the load of the dispatcher) or assign it
a dedicated server process.
2 If the user process can connect to a dispatcher, the listener gives the user process
the address of a dispatcher process. If the user process requests a dedicated server,
the listener creates a dedicated server process and connects the user process to it.
3 Once the connection has been established, either through a dispatcher or a
dedicated server process, the connection is maintained for the duration of the
session.
Technical Note
If the user call is from across a network, the dispatcher process chosen by the listener
must match the protocol of the network being used.
If the user connects as OPS$ on a remote client, remember to set the initialization
parameter REMOTE_OS_AUTHENT to TRUE.
Copyright Oracle Corporation, 1999. All rights reserved.
2
1
Database server
client
Connecting
User
process
User
process
Listener
Dispatcher
process
D001
Dispatcher
process
D002
3
.....................................................................................................................................................
7-10 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
Processing a Request
1 A user sends a request to its dispatcher.
2 The dispatcher places the request into the request queue in the System Global Area
(SGA).
3 A shared server picks up the request from the request queue and processes the
request.
4 The shared server places the response on the calling dispatchers response queue.
5 The response is handed off to the dispatcher.
6 The dispatcher returns the response to the user.
Once the user call has been completed, the shared server process is released and is
available to service another user call in the request queue.
Request Queue
One request queue is shared by all dispatchers.
Shared servers monitor the request queue for new requests.
Requests are processed on a first-in, first-out basis.
Response Queue
Shared servers place all completed requests on the calling dispatchers response
queue.
Each dispatcher has its own response queue in the SGA.
Each dispatcher is responsible for sending completed requests back to the
appropriate user process.
Users are connected to the same dispatcher for the duration of a session.
Copyright Oracle Corporation, 1999. All rights reserved.
SGA
SGA
Dedicated Server
Multithreaded Server
Shared pool and other
memory structures
Stack
space
User
session
data
Cursor
state
User
session
data
Cursor
state
Shared pool and
other memory
structures
Stack
space
PGA
PGA
without the multithreaded
server, user session data is
kept in the PGA.
with the multithreaded
server, data is held in
the SGA.
SGA, PGA, and Multithreaded Server
.....................................................................................................................................................
7-12 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
Configuring the Multithreaded Server
Configuring the MTS
To configure the multithreaded server, you need to edit the initialization parameter file
for your instance.
After setting these initialization parameters, restart the instance, which at this point
will use the multithreaded server configuration.
The multithreaded server architecture requires Net8.
User processes targeting the multithreaded server must connect through Net8, even
if they are on the same machine as the Oracle instance.
Technical Note
Most of the parameters have sensible defaults. On many systems, the only parameters
that should be configured are MTS_SERVERS and MTS_DISPATCHERS.
Copyright Oracle Corporation, 1999. All rights reserved.
LOCAL_LISTENER
Listener
local_listener = list1
Init.ora file
Dispatcher
Dnnn
Dispatcher
Dnnn
Dispatcher
Dnnn
tnsnames.ora
In Oracle8 servers only, this parameter specifies
service names for listeners with which dispatchers
register their services.
.....................................................................................................................................................
7-14 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
The LOCAL_LISTENER Parameter (continued)
The Net8 listeners need to be running on the same machine as the instance.
The instance and dispatchers register certain information with the listener. The
listener uses this information to connect clients to the appropriate dispatchers and
dedicated servers.
Technical Note
MTS_LISTENER_ADDRESS and MTS_MULTIPLE_LISTENERS should be
considered obsolete parameters.
They are maintained for the current release, and are included for backward
compatibility.
When the LOCAL_LISTENER parameter is present, it overrides the
MTS_LISTENER_ADDRESS and MTS_MULTIPLE_LISTENERS parameters.
Parameter Type String
Parameter class: Static (cannot use ALTER SYSTEM to modify)
Default value: If no service name address is specified, the behavior is as
follows:
First looks for default PLUG and PLAY listener, then
looks for default TCP/IP port 1521, and last the
ORACLE_SID value
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-15
.....................................................................................................................................................
Configuring the Multithreaded Server
The MTS_SERVICE Parameter
MTS_SERVICE specifies the name of the database you want to be associated with the
dispatcher.
Oracle always checks for such a service before establishing a normal database
connection.
The name you specify must be unique. It should not be enclosed in quotation marks. It
is a good idea for this name to be the same as the instance name. That way, if the
dispatcher is unavailable for any reason, the CONNECT string still connects the user
to the database.
Parameter Type String
Parameter class: Static (cannot use ALTER SYSTEM to modify)
Default value: Value of DB_NAME initialization parameter
Copyright Oracle Corporation, 1999. All rights reserved.
Instance: TST8i
MTS_SERVICE
mts_service = TST8i
Init.ora file
Dispatcher
Dnnn
Dispatcher
Dnnn
Dispatcher
Dnnn
Registered as SERVICE TST8i
Establishes the name of the service for which the
dispatchers of the MTS instance associate
.....................................................................................................................................................
7-16 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
The MTS_DISPATCHERS Parameter
The database administrator uses MTS_DISPATCHERS to enable various attributes for
each dispatcher.
Oracle8 supports a name-value syntax (similar to the syntax used by Net8) to enable
the specification of the existing and additional attributes in a position-independent,
case-insensitive manner.
For example:
MTS_DISPATCHERS = (PROTOCOL=TCP)(DISPATCHERS=3)
Parameter Type String (Specify as a quoted string)
Parameter class: Dynamic (can use ALTER SYSTEM to modify)
Default value: NULL
Copyright Oracle Corporation, 1999. All rights reserved.
MTS_DISPATCHERS
mts_dispatchers = (PROTOCOL=TCP)(DISPATCHERS=2) \
(PROTOCOL=IPC)(DISPATCHERS=1)
Dispatcher
D002
TCP/IP
Init.ora file
Dispatcher
D003
IPC
Dispatcher
D001
TCP/IP
Specifies the number of dispatchers initially started
for a given protocol
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-17
.....................................................................................................................................................
Configuring the Multithreaded Server
The MTS_DISPATCHERS Parameter (continued)
One and only one of the following attributes is required: ADDRESS, DESCRIPTION,
or PROTOCOL.
Note: Further details on the MTS_DISPATCHERS parameter can be found in the
Initialization Parameters section in the Oracle8i Reference Manual
Calculating the Initial Number of Dispatcher Processes
Once you know the number of possible connections per process for your operating
system, calculate the initial number of dispatcher processes to create for each network
protocol during instance startup using the following formula. Connections per
dispatcher is operating system-dependent.
Number Maximum number of concurrent sessions
of = CEIL (------------------------------------)
Dispatchers Connections per dispatcher
Attribute Description
PROTOCOL
(PRO or PROT)
The network protocol for which the dispatchers listen
ADDRESS
(ADD or ADDR)
The network address (in Net8 syntax) on which the
dispatchers listen (Includes the protocol)
DESCRIPTION
(DES or DESC)
The network description (in Net8 syntax) of the end
point on which the dispatchers will listen (Includes the
protocol)
DISPATCHERS
(DIS or DISP)
The initial number of dispatchers to start (default is 1)
SESSIONS
(SES or SESS)
The maximum number of network sessions for each
dispatcher
LISTENER
(LIS, LIST)
The network name of an address or address list of the
Net8 listeners with which the dispatchers register
(The listener or listeners can reside on other nodes.)
SERVICE
(SER, SERV)
The service name that the dispatchers register with the
Net8 listeners
(The SERVICE attribute overrides the
MTS_SERVICE parameter. This attribute
specifies a service name that the dispatchers use to
register.)
.....................................................................................................................................................
7-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
The MTS_MAX_DISPATCHERS Parameter
MTS_MAX_DISPATCHERS specifies the maximum number of dispatcher processes
that can run simultaneously.
After instance startup, you can start more dispatcher processes if needed; however,
you can only start dispatchers that use protocols mentioned in the parameter file of the
database.
For example, if the parameter file starts dispatchers for TCP and SPX, you cannot later
start dispatchers for protocol DECnet without changing the parameter file and
restarting the instance.
Parameter Type Integer
Parameter class: Static
Default value: If dispatchers are configured, then defaults to
whichever is greater: 5 or the number of
dispatchers configured
Range of values: Operating systemdependent
Copyright Oracle Corporation, 1999. All rights reserved.
MTS_MAX_DISPATCHERS
mts_max_dispatchers = 5
Init.ora file
Dispatcher
D002
TCP/IP
Dispatcher
D003
IPC
Dispatcher
D001
TCP/IP
Dispatcher
D004
Dispatcher
D005
Specifies the maximum number of dispatchers that
can be started
Needs ALTER SYSTEM command to add more
dispatchers than initially started
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-19
.....................................................................................................................................................
Configuring the Multithreaded Server
Estimating the Maximum Number of Dispatches
To estimate the maximum number of dispatcher processes an instance requires, use the
following formula:
Maximum number of concurrent sessions
MTS_MAX_DISPATCHERS = _________________________________
Connections per dispatcher
For example, assume that your system typically has 900 users concurrently connected
by way of TCP/IP and 600 users connected by way of SPX, and supports 255
connections per process. In this case, the MTS_DISPATCHERS parameter should be
set as follows:
MTS_DISPATCHERS = "(PROTOCOL=TCP) (DISPATCHERS=4)"
MTS_DISPATCHERS = "(PROTOCOL=SPX) (DISPATCHERS=3)"
Adding or Removing Dispatchers
If the load on the dispatcher processes is consistently high, start additional
dispatcher processes to route user requests without waiting. You may start new
dispatchers until the number of dispatchers equals MTS_MAX_DISPATCHER.
The load on the dispatchers can be monitored using the data dictionary views
V$CIRCUIT and V$DISPATCHER.
(Detailed tuning of the MTS is covered in the performance tuning class.)
In contrast, if the load on dispatchers is consistently low, reduce the number of
dispatchers.
The following example adds a dispatcher process where the number of dispatchers
was previously two:
ALTER SYSTEM SET MTS_DISPATCHERS=(PROTOCOL=TCP)(DISPATCHERS=3);
You can also use the ALTER SYSTEM command to remove dispatchers to the number
specified in MTS_DISPATCHERS. If you want to have fewer than that, edit the
init.ora file, and bounce the database.
.....................................................................................................................................................
7-20 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
The MTS_SERVERS Parameter
MTS_SERVERS specifies the number of server processes that you want to create
when an instance is started up.
Parameter Type Integer
Parameter class: Dynamic (can use ALTER SYSTEM to modify)
Default value: 0
Range of values: Operating systemdependent
Copyright Oracle Corporation, 1999. All rights reserved.
MTS_SERVERS
mts_servers = 6
Init.ora file
S001
S002
S003
S004
S005
S006
Specifies number of shared servers initially started
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-21
.....................................................................................................................................................
Configuring the Multithreaded Server
Setting the Initial Number of Shared Server Processes
The appropriate number of initial shared server processes for a database system
depends on how many users typically connect to it and how much processing each
user requires.
If each user makes relatively few requests over a period of time, then each
associated user process is idle for a large percentage of time. In that case, one
shared server process can serve 10 to 20 users.
If each user requires a significant amount of processing, a higher ratio of server
processes to user processes is needed to handle requests.
If you want Oracle to use shared servers, you must set MTS_SERVERS to at least 1. If
you omit the parameter or set it to 0, Oracle does not start any shared servers at all.
You can subsequently set MTS_SERVERS to a number greater than 0 while the
instance is running.
It is best to estimate fewer initial shared server processes. Additional shared servers
start automatically when needed and are deallocated automatically if they remain idle
for too long.
Note that the initial servers always remain allocated, even if they are idle.
If you set the initial number of servers too high, your system might incur
unnecessary overhead.
Experiment with the number of initial shared server processes, and monitor shared
servers until you find the ideal system performance for typical database activity.
Modifying the Minimum Number of Shared Server Processes
After starting an instance, you can change the minimum number of shared server
processes by using the SQL ALTER SYSTEM command.
Oracle will eventually terminate servers that are idle when there are more shared
servers than the minimum limit you specify.
If you set MTS_SERVERS to 0, Oracle terminates all current servers when they
become idle and does not start any new servers until you increase
MTS_SERVERS.
Setting MTS_SERVERS to 0 effectively disables the multithreaded server
temporarily.
To control the minimum number of shared server processes, you must have the
ALTER SYSTEM privilege.
The following statement sets the number of shared server processes to two:
ALTER SYSTEM SET MTS_SERVERS = 2
.....................................................................................................................................................
7-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
The MTS_MAX_SERVERS Parameter
MTS_MAX_SERVERS specifies the maximum number of shared server processes
that can run simultaneously.
Estimating the Maximum Number of Shared Servers
In general, set this parameter for an appropriate number of shared server processes at
times of highest activity. Experiment with this limit, and monitor shared servers to
determine an ideal setting for this parameter.
To get the maximum numbers of servers started, query the data dictionary view
V$MTS.
Parameter Type Integer
Parameter class: Static
Default value: Defaults to whichever is greater: 20 or 2 times the
value of MAX_SERVERS
Range of values: Operating systemdependent
Copyright Oracle Corporation, 1999. All rights reserved.
MTS_MAX_SERVERS
mts_max_servers = 10
Init.ora file
S001
S002
S003
S004
S005
S006
S007
S008
S009
S010
Specifies the maximum number of shared servers
that can be started
Allocates shared servers dynamically if more than
initially started are needed
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 7-23
.....................................................................................................................................................
Data Dictionary
Data Dictionary
Note: When using MTS, you should first start the listener, then the database, so that
the dispatchers can immediately register with the listener.
V$CIRCUIT This view contains information about
virtual circuits, which are user connections to
the database through dispatchers and servers.
V$SHARED_SERVER This view contains information on the shared
server processes.
V$DISPATCHER This view provides information on the
dispatcher processes.
V$MTS This view contains information for tuning the
multithreaded server.
V$QUEUE This view contains information on the
multithreaded message queues.
V$SESSION This view lists session information for each
current session.
Copyright Oracle Corporation, 1999. All rights reserved.
Wait
Processing
Connection Pooling
Dispatcher
D001
TCP/IP
Client Server
Connection being
idle for a period
gets temporarily
disconnected.
3
1
1
1
2
.....................................................................................................................................................
7-26 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
Enabling Connection Pooling
In order to enable the connection pooling, additional parameters must be configured
for MTS_DISPATCHERS. The ideal scenario for connection pooling is networks on
which many clients run interactive high idle, high search time applications, such as
messaging and OLAP, and can afford to wait to get connected to a dispatcher. The
additional attributes to set for MTS_DISPATCHERS are detailed in the following
table.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned that the
multithreaded server:
Increases maximum users per node
Reduces system overhead
Eliminates need to modify existing applications
Offers automatic load balancing
Can be set up to support connection pooling
.....................................................................................................................................................
7-30 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 7: Multithreaded Server Usage and Configuration
.................................
8
Connection Manager
Usage and Configuration
.....................................................................................................................................................
8-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 8: Connection Manager Usage and Configuration
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Identify the capabilities of Connection Manager
Configure connection concentration
Enable network access control
Configure multiprotocol interchange
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 8-3
.....................................................................................................................................................
Objectives
Connection Manager
Oracle Connection Manager is a multipurpose, networking solution for Net8 that
provides greater resource utilization for increased scalability, multiprotocol
connectivity, and secure network access control.
Connection Concentration
Oracle Connection Manager deployed as a connection concentrator requires no
reengineering of existing Oracle-based applications. Oracle7, Oracle8, and Oracle8i
compatible applications can immediately take advantage of the benefits of three-tier
computing, which include:
Efficient use of existing system and network resources for MTS environments
Scalable systems to accommodate large numbers of concurrent users
Support for multiple Oracle Connection Managers supported to efficiently
partition a network for maximum performance
Copyright Oracle Corporation, 1999. All rights reserved.
Overview
Server
Middle
tier
Connection
Manager
Listener
Client
1
Connection
concentration
2
Network access
control
3
Multiple protocol
interchange
.....................................................................................................................................................
8-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 8: Connection Manager Usage and Configuration
Access Control
Oracle Connection Manager can be set up to filter connections based on origin,
destination, or Oracle system identifier (SID). Additionally, when used in conjunction
with the security features of Oracle Advanced Security option, connections can be
rejected or accepted on the basis of whether or not security is required.
Restricts access based on source address, destination address, or Oracle system
identifier (SID)
Optionally implemented with Oracle Advanced Security option to restrict access
based on use of security
Network traffic statistics generated for auditing purposes
Multiprotocol Support
Oracle Connection Manager provides multiprotocol connectivity, so that a client and
server with different networking protocols can communicate with one another.
Transparent protocol conversion for protocols supported by Net8, including:
APPC (LU6.2)
DECnet
Named Pipes
SPX/IPX
TCP/IP
Bidirectional protocol conversion
Scalable from PC to mainframe class machines
Robust diagnostics with multilevel error logging and step-by-step tracing
Technical Note
The Connection Manager is a stand-alone product that can be installed on any
supported platform. Note, however, that the connection concentration does not work
when connection pooling is enabled.
To benefit from the connection concentration feature, it is recommended that
Connection Manager be installed on a middle tier in a multitiered environment. This
heavily reduces the resource consumption on the end tier, and enables highly scalable
configurations.
Connection concentration requires the MTS server, whereas access control and
multiprotocol connectivity do not.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 8-5
.....................................................................................................................................................
Configuring Connection Manager
Configuring Connection Manager
Connection Concentration
You can configure connection concentration, network access control, or multiprotocol
interchange in any combination.
There are, however, certain requirements dependent on the feature you want to
configure.
CMGW Process
In general, you need to have started the CMGW process. You do this through a special
control utility, CMCTL, which is covered later.
Note: In Oracle8 on NT, these utilities are called CMGW80 and CMCTL80,
respectively.
The CMGW process acts as the hub of the Connection Manager. The function of
CMGW is to:
Register itself with CMADMIN for connection concentration
Listen for incoming SQL*Net 2.x or NET 8.x connection requests
Initiate connection requests to NET 8.x listeners for clients
Relay data between the client and server
Answer requests initiated by CMCTL
The CMGW process listens by default on port 1610 or 1600 (platform dependent).
Copyright Oracle Corporation, 1999. All rights reserved.
3
1
Configuring Connection Manager
Server Middle tier
cman.ora listener.ora
init.ora
Client
tnsnames.ora
CMGW
Server
MTS
CMADM
2
2
.....................................................................................................................................................
8-6 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 8: Connection Manager Usage and Configuration
Slide Example
1 When configuring for network access control, connection concentration, or
multiprotocol interchange, you need to have started the CMGW Connection
Manager process.
The CMGW process either rejects your request if you are denied access or
connects you to a listener that either spawns and redirects you to a server process
or to a dispatcher in a multithreaded server environment.
2 When using Connection Manager with an Oracle Names server, an additional
process, CMADMIN, needs to be started.
Note: In Oracle8 on NT, this utility is called CMADM80.
3 The CMADMIN is a multithreaded process that is responsible for all
administrative issues of the Connection Manager. Its primary function is to
maintain address information in the Oracle Names server for the SQL*Net 2.x and
NET 8.x clients.
Other responsibilities include:
Processing the CMGW registration
Locating the local Oracle Names server
Identifying all listeners serving at least one database instance
Registering source route address information about the CMGW and listeners
Monitoring changes in the network and updating the Names server
Answering requests initiated by CMCTL
The final requirement for connection concentration is that the multithreaded server on
the destination server needs to be configured with a special parameter for the
dispatcher setting, which is covered later.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 8-7
.....................................................................................................................................................
Configuring Connection Manager
Connection Concentration Configuration
In order to configure for connection concentration, the listener address for the
Connection Manager CMGW process needs to be listed as well as the destination
listener.
The following are the components of the service name TST8 in the example:
1 ADDRESS specified for the Connection Manager process. Both the node on which
Connection Manager is running and the port number need to be specified.
2 ADDRESS specified for the listener on the destination node. Both port and node
names need to be specified.
3 The database SID or the SERVICE_NAME to which the connection needs to be
established, and in order to enable connecting through Connection Manager, the
SOURCE_ROUTE needs to equal YES.
The Connection Manager basically acts as a router, pointing the connection request to
the next hop.
Copyright Oracle Corporation, 1999. All rights reserved.
CMCTL Arguments
CMCTL usage: [cmctl] <command> <process_name> [argument]
where <command> is one of following:
* start - start up process_name
* stop - stop the process_name
* status - get statistics from the process_name
* log_on - ask process_name to turn logging on
* log_off - ask process_name to turn logging off
* trace_on - ask process name to turn tracing on
NOTE: the user MUST specify a trace level
(USER or ADMIN) in the argument field
* trace_off - ask process name to turn tracing off
* version - ask version number of CMCTL control program
* exit - quit the CMCTL control program
process_name is one of cman, cm process or adm process
* cman - will ask the Connection Manager (both cman and adm)
* cm - will ask the Connection Manager process only
* adm - will ask the Connection Manager Admin process only
argument is only supplied trace_on
* to trace_on - argument is considered the trace level
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 8-19
.....................................................................................................................................................
Configuring Connection Manager
Connection Manager and Names Server
If using Oracle Names server, the Connection Manager automatically updates the
addresses in the Names server, inserting the address for the CMAN into the existing
address.
Note: If more than one Oracle Connection Manager is used in the connection path,
you cannot use Oracle Names to connect clients through it.
In the client sqlnet.ora file, the following parameter can be set:
Parameter Type Description
USE_CMAN This can be set to TRUE or FALSE.
TRUE forces the client to connect to the destination
through the CMAN using a randomly picked indirect
path (address list with at least one CMAN address).
TRUE and no indirect paths in the description, then a
randomly picked path is used.
FALSE or not defined, then a path is picked at random.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned that
Connection Manager is a multipurpose networking
service for Oracle environments. It facilitates:
Increased system scalability
Client connection access control
Multiprotocol connectivity
These features save system resources, improve
performance, extend flexibility in transport
protocols, and improve system security
.....................................................................................................................................................
8-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 8: Connection Manager Usage and Configuration
.................................
9
Troubleshooting the
Network Environment
.....................................................................................................................................................
9-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Set logging and tracing parameters
Analyze and troubleshoot network problems using
log and trace files
Store audit trail information in the database
Format trace files using Trace Assistant
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 9-3
.....................................................................................................................................................
Overview
Overview
Logging and Tracing Files
Net8 provides methods for understanding and resolving network problems through the
use of log and trace files. These files keep track of the interaction between network
components as errors occur. Evaluating this information helps you to troubleshoot
problems associated with the different networking components.
The output from tracing and logging are stored in ASCII files. The location and how
much tracing information can be written to these files are configurable.
Copyright Oracle Corporation, 1999. All rights reserved.
Overview
listener.ora
Client Server
sqlnet.ora
cli.trc
sqlnet.log
sqlnet.ora
svr_xxx.trc
sqlnet.log
listener.log
listener.trc
Middle tier
names.ora
names.trc
sqlnet.log
cman.ora
cman.trc
Tracing and logging can help troubleshoot
networking problems.
.....................................................................................................................................................
9-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Troubleshooting Checklist
Initial Troubleshooting Checklist
If you experience problems with your network and the error codes returned do not give
you the necessary information to correct your problem, then make sure that the basic
functions are working.
Verify the following:
Check that you can establish a basic connection from your client to the server.
This ensures that the underlying network is operational.
Check that you can make a local database connection.
This ensures that there are no database-related problems.
Check that you have the relevant adapter installed on the client and the server.
On UNIX, you find an executable called adapters, which you can use to test if
any executable has the adapter linked in.
Example adapter Oracle, shows you if the Oracle kernel has your adapter
linked in. If it is not linked in or not. If not, you have to relink your executable.
On NT, you can verify that you have the right adapter by using the Oracle
Installer and checking the installed products.
Copyright Oracle Corporation, 1999. All rights reserved.
Troubleshooting Checklist
Troubleshooting checklist:
Can you connect from the client to the server
without using an Oracle application?
Can you make a local database connection?
Is the relevant adapter installed on both the client
and server?
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 9-5
.....................................................................................................................................................
Troubleshooting Checklist
Initial Troubleshooting Checklist (continued)
Check that the listener is configured for the correct database SID and that the
listener has been started.
This ensures the server-side connectivity.
Check Oracle connectivity using Net8 Assistant or the TNSPING utility.
Use the Net8 Assistant Test Connection feature to check that you can connect to
your destination. This should verify if your configuration files are incorrect.
Use TNSPING, which is a utility that determines whether or not a service (for
example, an Oracle database, an Oracle Names server, or any other Oracle service)
on a Net8 network can be successfully reached.
If you still have a problem with your network, then use logging or tracing to get
additional information.
You can enable tracing for all major components of Net8. Later in this lesson, you look
at how logging and tracing can be enabled for the client side.
This is in most cases the best place to start.
Copyright Oracle Corporation, 1999. All rights reserved.
Troubleshooting Checklist
Troubleshooting checklist:
Is the listener configured for the database or SID,
and is it running?
Can you connect using Net8 Configuration
Assistant or the TNSPING utility?
Have you turned logging or tracing on for more
detailed information?
.....................................................................................................................................................
9-6 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
TNSPING Utility
TNSPING Utility
TNSPING is a utility that determines whether or not a service such as an Oracle
database or a Names server on a Net8 network can be successfully reached.
A successful connect from a client to a server (or from a server to another server)
using TNSPING displays an estimated round-trip time (in milliseconds) to reach the
Net8 service.
If the connection fails, TNSPING displays a message describing the error that
occurred. You can see the network error that is occurring without the overhead of
using a database connection.
TNSPING differs from the way other Oracle application connect. It does not require a
username and password to check the underlying connectivity.
Copyright Oracle Corporation, 1999. All rights reserved.
TNSPING Utility
Usage: tnsping <address> [<count>]
Example: tnsping ORCL 5
Copyright(c) Oracle Corp. 1998.All rights reserved.
Attempting to contact
(ADDRESS=(PROTOCOL=TCP)(HOST=shkhan-lp)(PORT=1521))
OK (290 msec)
OK (100 msec)
OK (70 msec)
OK (70 msec)
OK (60 msec)
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 9-7
.....................................................................................................................................................
Net8 Assistant: Logging and Tracing
Net8 Assistant: Logging and Tracing
Enabling Logging and Tracing
To turn tracing on for the client side, you have two options. You can use the Oracle
Net8 Configuration Assistant, which saves your preferences to a profile. A profile is
stored and implemented through a configuration file called sqlnet.ora.
The other option is to edit the profile yourself. This approach is not recommended,
because it increases the possibility of configuration errors.
To configure tracing and logging, start Net8 Assistant and select Profile>General.
Copyright Oracle Corporation, 1999. All rights reserved.
SQLNET.ORA: Logging
# C:\ORANT\NETWORK\ADMIN\SQLNET.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle Net8 Assistant
LOG_FILE_CLIENT = net8.log
NAMES.PREFERRED_SERVERS =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = shkhan-lap)(PORT =
1621))
)
NAMES.DEFAULT_DOMAIN = world
LOG_DIRECTORY_CLIENT = c:\orant\network
NAMES.DIRECTORY_PATH= (ONAMES)
.....................................................................................................................................................
9-10 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Net8 Tracing
The tracing facility produces a detailed sequence of statements that describe network
events as they are executed.
By tracing an operation, you can obtain more information on the internal operations of
the components of Net8 than is provided in a log file. This information is output to
files that can be evaluated to identify the events that led to an error.
Tracing Precautions
The tracing facility uses a large amount of disk space and can have a significant impact
on system performance. Therefore, you should use tracing only when necessary.
Use the Net8 Configuration Assistant to enable tracing on a client. Tracing is a feature
through which you can obtain information about the internal operations of Net8 that
can be useful in troubleshooting problems in your networking environment.
This feature is disabled by default.
Configuring Client Tracing
To configure tracing on the client using the Net8 Configuration Assistant, proceed as
follows:
1 From the Net8 Assistant, click the Profile icon in the directory tree.
2 Select General from the pull-down menu.
3 Click the Tracing tab.
Copyright Oracle Corporation, 1999. All rights reserved.
SQLNET.ORA: Tracing
# C:\ORANT\NETWORK\ADMIN\SQLNET.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle Net8 Assistant
TRACE_DIRECTORY_CLIENT = c:\orant\network
TRACE_FILE_CLIENT = net8trc
TRACE_LEVEL_CLIENT = SUPPORT
TRACE_UNIQUE_CLIENT = on
LOG_FILE_CLIENT = net8.log
LOG_DIRECTORY_CLIENT = c:\orant\network
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 9-13
.....................................................................................................................................................
Net8 Assistant: Logging and Tracing
Client Profile Tracing Parameters (continued)
TRACE_LEVEL_CLIENT Turns tracing on or off to a certain specified level.
Default Value: OFF: No trace output
USER: User trace information
ADMIN: Administration trace information
SUPPORT: Worldwide Customer Support tracing
information
Example: trace_level_client=user
TRACE_UNIQUE_CLIENT Used to make each client trace file have a unique
name to prevent each trace file from being
overwritten with the next occurrence of the client.
The PID is attached to the end of the filename.
Default Value: OFF
Example: trace_unique_client=on
.....................................................................................................................................................
9-14 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Listener Audit Trail
Audit Trail
The listener log file contains audit trail information you can use to gather and analyze
network usage and statistical information whenever one of the following occurs:
A client connection request
A start, stop, status, reload, or service command issued by the listener control
utility
In a client connection request, the user ID is recorded as well as the platform, protocol,
and software used to make the connection.
Audit trail information can be used to view trends and user activity by first storing it in
a table and then collating it into a report format. To import the data into a table, use an
import utility such as SQL*Loader.
Note: The audit trail feature is switched on by default, and there is no way to turn it
off.
For more information on SQL*Loader, refer to the Oracle8i Utilities Guide.
Copyright Oracle Corporation, 1999. All rights reserved.
Trace Assistant
The Trace Assistant utility will help you diagnose and
troubleshoot network problems by giving you a better
understanding of the following:
Flow of packets between network nodes
Components at which Net8 is failing
Error codes related to the problem
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 9-19
.....................................................................................................................................................
Trace Assistant
Trace Assistant Options
Trace Assistant can be run against an existing trace file with a number of options. The
output is summarized and in a more readable format than in a regular trace file. An
example could be a sample of statistics to see how many packages have been
transferred.
trcasst -s cli.trc
Trace File Statistics:
-------------------------------------------------------------------------------------------------------
SQL*Net:
Total Calls: 73 sent 109 received, 53 upi
Total Bytes: 8082 sent, 8471 received,
Average Bytes: 110 sent, 811 received,
Maximum Bytes: 504 sent, 2048 received,
GRAND TOTAL
PACKETS
sent: 73 received: 109
Copyright Oracle Corporation, 1999. All rights reserved.
Trace Assistant
Usage: trcasst [options] <filename>
[options] default values are: -odt -e -s
<filename> is always the last argument
Options can be zero or more of the following:
-o Enables display of SQL*Net and TTC information
After the -o the following options can be used:
c or d for summary or detailed SQL*Net information respectively
u or t for summary or detailed TTC information respectively
q displays SQL commands (used together with u)
-p Enables application perfomance measurement (Internal Use)
-s Enables display of statistical information
-e Enables display of error information
After the -e, zero or one error decoding level may follow:
0 or nothing, translates NS error numbers
1 displays NS error translation plus all other errors
2 displays error number without translation
.....................................................................................................................................................
9-20 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Tracing for Other Net8 Components
In addition to tracing and logging parameters specified for the client side, it is possible
to use tracing for all other components of Net8. All parameter settings can be found in
Oracle8i Server Networking and Security Guide, Release 8.1.5.
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned that, in
special cases, you may be needed to troubleshoot a
network problem.
To find the error codes related to your problem,
first check the log files.
If this does not give you the needed information,
run through your checklist.
If the checklist does not provide the solution, use
tracing and investigate.
If everything is still unclear, call support.
.....................................................................................................................................................
9-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 9: Troubleshooting the Network Environment
Frequently Asked Questions
The following discussion points are taken from the most frequently asked questions
regarding topics in this lesson. This information is retrieved and analyzed in
cooperation with Oracle Worldwide Support.
Problem
How is Net8 tracing different from SQL*Net 2.x tracing?
Solution
Net8 tracing includes all the previous SQL*Net 2.x options and adds Oracle Trace
capability. You can manage your trace information through an Oracle Enterprise
Manager console in an Oracle Trace repository.
Problem
What are the *.cdf and *.dat files?
Solution
The *.cdf and *.dat files are created by Oracle Trace. To read these, you must use
the trcfmt utility. It will extract and format the data inside binary files (.cdf and
.dat extensions) into text files (.txt extension). To use this tool, type the
following at any command line prompt:
trcfmt collection.cdf
Note: collection is the name, with the path included if collection is not in the
directory in which the .cdf and .dat files exist. If you have collected several
processes within a single .cdf or .dat file, they are extracted to files with the name
of process_id.txt.
Once you have formatted the data to text, you can view the data through any text
editor.
.................................
10
Security in the Network
Environment
.....................................................................................................................................................
10-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Objectives
Copyright Oracle Corporation, 1999. All rights reserved.
Objectives
After completing this lesson, you should be able to
do the following:
Identify network security risks during data
transmission
Identify security features in Oracle Networking
products
Identify the features of the Advanced Security
option
Configure the components of the Advanced
Security option
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-3
.....................................................................................................................................................
Overview: Network Security Risks
Overview: Network Security Risks
Challenges in a Distributed Environment
The principle challenges in a networked environment include maintaining the
following:
Data privacy: Ensuring that data is not disclosed or stolen during transmission
Data integrity: Ensuring that data is not modified or disrupted during transmission
Authentication: Confidence that users, hosts, and clients identities are correctly
known
Authorization: Permitting a user, a program, or a process to access an object or set
of objects
Copyright Oracle Corporation, 1999. All rights reserved.
Compromised Authentication
Scott
username
password
Scott
Client A Server B
Client B
username
password
.....................................................................................................................................................
10-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Compromised Authorization
Compromised Authorization
You also need to have confidence in the way clients and servers are made known to
one another over the network, so that you have assurance not only that user Scott is
who he says he is, but that Client B and Client A are also what they claim to be.
Copyright Oracle Corporation, 1999. All rights reserved.
CLIENT A
username
password
Scott
CLIENT A
username
password
Compromised Authorization
Client A Server B
Client B
Scott
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-9
.....................................................................................................................................................
Network Security Solutions
Network Security Solutions
Copyright Oracle Corporation, 1999. All rights reserved.
Data Encryption
Encrypt
We will go public
on Wednesday.
Decrypt
fdh37djf246gsb[da,\ssk
We will go public
on Wednesday.
Machine A Machine B
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-11
.....................................................................................................................................................
Cryptographic Checksumming
Cryptographic Checksumming
Checksumming
Function of Sequencing
Labels each packet A, B, C before it transmits.
When the packet arrives, the server checks to see if the packet is in order.
Function of the MD5 Algorithm The message digest algorithm is available from
RSA. It performs the following tasks:
Makes a hash calculation on the contents of each packet
Records the value at the end of the packet
The server makes the same hash calculation to see if the value has changed.
Copyright Oracle Corporation, 1999. All rights reserved.
Cryptographic Checksumming
Encrypt
We will go public
on Wednesday.
Decrypt
We will go public
on Wednesday.
Machine A Machine B
We
will
A
go
pub-
B
-lic
on
C
Wedn-
esday
D
.....................................................................................................................................................
10-12 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Configuring Encryption and Checksumming
Encryption and Checksumming Parameters
You can negotiate whether to turn on encryption or checksumming by specifying four
of the Oracle Advanced Security option configuration parameters.
Note: The encryption seed value can be up to 70 characters. The greater the number of
characters used and variation of the characters, the greater the security. DES40 is used
in the example in the slide.
DES 56 and RC4 128 can also be used.
In the example in the slide, the machine is configured as a client using encryption and
a server using checksumming.
Default Encryption and Checksumming Values
If you do not specify any values for server encryption, client encryption, server
checksum, or client checksum, the corresponding configuration parameters do not
appear in the sqlnet.ora file. However, the Oracle Advanced Security option
defaults the value to ACCEPTED.
If no encryption or checksumming algorithm is specified on the server encryption,
client encryption, server checksum, or client checksum pages, the server side of
the connection uses the first algorithm in its own list of installed algorithms that
also appears in the clients list of installed algorithms.
Encryption and checksumming function independently of each other; encryption
can be activated while checksumming is off and vice versa.
Copyright Oracle Corporation, 1999. All rights reserved.
Authentication
1
2
Server
3
4
5
Server
Decrypt
Decrypt
Authentication
Server
Client
6
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-15
.....................................................................................................................................................
Enhanced User Authentication
Enhanced User Authentication
Authentication Adapters
Support for authentication services is provided through authentication adapters, which
are very much like the existing Net8 protocol adapters. Authentication adapters
integrate below the Net8 interface so that existing applications can take advantage of
new authentication systems transparently, without any changes to the application.
Copyright Oracle Corporation, 1999. All rights reserved.
Token Cards
Client
Oracle
server
Authentication
server
Step 1:
User enters username
and passcode.
Step 2:
Oracle verifies token
card details with the
authentication server.
Step 3:
Authentication server
authenticates
users and Oracle
server allows login.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-17
.....................................................................................................................................................
Biometric Authentication
Biometric Authentication
Biometric Authentication
The Oracle Advanced Security option provides support for the Oracle Biometric
Authentication Adapter. The authentication adapters are used on both the clients and
the database servers to communicate biometric authentication data between the
authentication server and the clients.
Supported Biometric Authentication Device Because a users fingerprint is
unique, only the true user can match the stored fingerprint scan. Oracle supports the
Identix Touchsafe II Biometric device.
The fingerprint of each user is enrolled into the security system.
To log in, users specify a service and place a finger on the Touchsafe II fingerprint
reader.
The fingerprint is scanned and compared to the previously stored fingerprint.
If the scan matches, the user is authenticated.
Copyright Oracle Corporation, 1999. All rights reserved.
Biometric Authentication
Client
Oracle
server
Authentication
server
Step 1:
Users fingerprint is
scanned.
Step 2:
Oracle verifies
fingerprint with the
authentication server.
Step 3:
Authentication
server authenticates
users and Oracle
allows login.
.....................................................................................................................................................
10-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Kerberos Authentication
Kerberos Adapters
Two adapters for the Kerberos authentication service are provided by Oracle:
Kerberos Authentication Adapter
CyberSAFE Challenger Authentication Adapter
Copyright Oracle Corporation, 1999. All rights reserved.
Kerberos Authentication
Kerberos is a trusted third-party authentication
system that relies on shared secrets. It assumes that
the third party is secure. It provides the following:
Single sign-on capabilities
Centralized password storage
Database link authentication
Enhanced PC security
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration 10-19
.....................................................................................................................................................
RADIUS Authentication
RADIUS Authentication
RADIUS Authentication
Remote Authentication Dial-In User Service (RADIUS) is a flexible, lightweight
protocol that provides the followings services:
Authentication
Authorization
Accounting
Centralized user information
Note: RADIUS is currently supported only with Oracle8i.
Supported RADIUS services
Various RADIUS server vendors are supported, as follows:
Lucent
ActivCard
Funk
Vasco
Bay Networks
Secure Computing
Copyright Oracle Corporation, 1999. All rights reserved.
RADIUS Authentication
Client
Oracle8i
server
RADIUS
server
Step 1:
Users logs on to
Oracle8i server
Step 2:
Oracle8i forwards
access request
to RADIUS server.
Step 3:
RADIUS
server authenticates
users and Oracle
allows login.
.....................................................................................................................................................
10-20 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Configuring Authentication
Configuration Recommendations
Set REMOTE_OS_AUTHENT to FALSE.
When configuring the Oracle authentication adapters, it is strongly recommended
that you add the following parameter to the initialization file (init.ora) used
for the database instance:
REMOTE_OS_AUTHENT= FALSE
If REMOTE_OS_AUTHENT is set to FALSE, and the server cannot support any
of the authentication services requested by the client, the authentication service
negotiation fails, and the connection is terminated.
Note: Setting REMOTE_OS_AUTHENT to TRUE can create a security hole,
because someone using a nonsecure protocol (for example, TCP) can perform an
operating systemauthorized login (formerly referred to as an OPS$ login).
If the SQLNET.AUTHENTICATION_SERVICES parameter is set to NONE in
the sqlnet.ora file on the server or client, the database attempts to use the
username and password provided to log the user on. But, if
REMOTE_OS_AUTHENT is set to FALSE, the connection fails.
Set OS_AUTHENT_PREFIX to Null.
Authentication servicebased user names can be long, and Oracle usernames are
limited to 30 characters. So, it is strongly recommended that you enter a null value
for the OS_AUTHENT_PREFIX parameter in the initialization file (init.ora)
used for the database instance:
OS_AUTHENT_PREFIX=""
Copyright Oracle Corporation, 1999. All rights reserved.
Single Sign-On
With single sign-on, users get access to selected
databases in the environment without having to
provide a username and password multiple times.
The following single sign-on services are supported:
Kerberos
CyberSafe
Oracle Security Server
.....................................................................................................................................................
10-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Secure Sockets Layer
Copyright Oracle Corporation, 1999. All rights reserved.
DCE Integration
Distributed Computing Environment (DCE) Integration
transparently use and promote Oracle tools and
applications to access Oracle servers in a DCE
environment. DCE security provide the following
services:
DCE authentication and single sign-on
Authorization
Data integrity and privacy
.....................................................................................................................................................
10-24 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Lesson 10: Security in the Network Environment
Summary
Copyright Oracle Corporation, 1999. All rights reserved.
Summary
In this lesson, you should have learned:
Data theft, modification, and disruption are
increasing network risks.
Encryption, checksumming, and authentication
mechanisms are used to counter these risks.
The Advanced Security option is implemented to
provide encryption, checksumming, and
authentication.
................................
Practices
A
.....................................................................................................................................................
A-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix A: Practices
Practice 3
Before beginning this practice, your instructor should provide you with the server name
on which you will configure your listener and a port number on which your listener will
be listening. Throughout this practice, replace all the occurrences of nn with the number
assigned to you by the instructor.
1 Create a listener lsnrnn using Net8 Assistant on the client PC. The listener must be
configured for the server provided by the instructor; this server contains an Oracle
database Unn. The listener must also be configured for the TCP/IP protocol only
and must listen for incoming connections on the port provided by the instructor. Do
not configure the listener to use prespawned dedicated servers.
Note: For this classroom setup, the listener configuration file must be created on the
client PC using Net8 Assistant and, in later steps, transferred via FTP or similar file
transfer application on the server.
2 View the contents of the listener.ora file to verify the configuration details.
3 Transfer the listener configuration file from the client to the server using FTP or any
similar file transfer utility. The listener configuration file must be transferred from
the client to the directory on the server that will be searched for Net8 configuration
files.
4 Manually add a parameter to the listener.ora file so that the listener creates a
log file called lsnrnn.log in the $TNS_ADMIN/log directory. If the log
directory does not exist in the $TNS_ADMIN directory, create it.
Note: This step is necessary for the classroom setup. If an entry for the listener log
file is not inserted into your listener.ora file, your listener will attempt to write
to the default listener log directory.
5 Using the Listener Control utility, start your listener.
6 View the contents of the listener log file.
7 Start up your database instance.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration A-3
.....................................................................................................................................................
Practice 4
Practice 4
If you are unsure of the name of your client, please ask the instructor how to obtain the
name.
1 Using the local naming method in Net8 Assistant, configure the client side.
The protocol used is TCP/IP. The port number for the listener you should connect
to is the port number provided for the listener in the previous practice. SID is Unn.
Note: Use the Oracle8i Release 8.0 Database SID method to connect instead of the
Oracle8i Release 8.1 Service Name method.
2 Test that the service is operational.
3 Investigate the contents of the tnsnames.ora file.
4 Connect to the server as system/manager using SQL*Plus and verify that you
are connected to the correct instance by querying the V$INSTANCE view. When
everything is working, have the group or person next to you edit your
tnsnames.ora file in order to provoke an error either by specifying a wrong port
to connect to or a wrong node name, database, or service name.
When they are done, try to correct the error by regenerating the tnsnames.ora
file by hand.
5 Using Net8 Assistant, configure your client to make connections to the listener on
the server using the new service name instead of the instance name.
Hint: Use Oracle8i release 8.1compatible identification.
6 Connect to the server as system/manager using SQL*Plus and verify that you
are connected to the correct instance as was done in step 4.
7 Shut down the database instance and the listener, and configure your database
instance (Unn) for automatic instance registration.
Hint: Look at the parameters SERVICE_NAMES and INSTANCE_NAME in the
initSID.ora file.
8 Check that the instance has been registered and which listener has the handle.
9 Restart the database and have it register with your working listener lsnrnn.
Hint: Look at the parameters LOCAL_LISTENER in the initSID.ora file.
Create a new tnsnames.ora manually do not use the Net8 Assistant.
.....................................................................................................................................................
A-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix A: Practices
Practice 6
1 Create a Names server on your local PC node and view the contents of the Names
configuration file. Do not configure the Names server with a region database. Use
1575 as the port on which the Names server will accept incoming name resolution
requests. Make sure the DB_DOMAIN parameter is set to NULL.
Note: In this class, the Names server is created on your local PC node; therefore,
your node will act as a client as well as a Names server. Ideally, a Names server
should reside on a dedicated middle-tier node on the network.
Bring up the DOS box and enter hostname to determine the name of your client
PC.
2 Start up the Names server, and add a service name for the database Unn to the
Names server. Use the attributes for the database service name defined in your
existing tnsnames.ora file.
Note: Do not use Oracle8i release 8.0compatible identification to connect
3 Using Net8 Assistant, configure your client profile to use Oracle Names, and
assign the previously created Names server as the preferred Names server for your
client profile.
4 Connect to Unn using SQL*Plus and verify if the Names server is operational by
using ONAMES as the only naming method.
5 Using the Windows Control panel, shut down the Names server. After the Names
server is shut down, perform the following functions using the Names Control
utility:
a View the status of the Names server by using the Names Control Utility.
b What is the error message, and why does it occur?
c Set the server to the Names server that you previously configured.
d What is the error message, and why does it occur?
e Start up the Names server.
6 If you do not plan to attempt the optional practice, configure your profile as before,
so that it uses the TNSNAMES naming method rather than ONAMES.
Optional Practice
7 Ensure that the Names server is running. Restart the Net8 Assistant utility, then
reconfigure your Names server to use a region database. The region database
should now reside on the Unn database on the server, while the Names server still
resides on the client. Use the SYSTEM user to run the Names server initialization
script (Typically you would use a separate user for this purpose).
Note: Do not use Oracle8i release 8.0compatible identification when connecting.
8 Add a service name for Unn to the newly created region database on Unn itself.
Note: Use a different service name with the same connection attributes.
9 Attempt to connect to Unn using SQL*Plus after the service name is added.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration A-5
.....................................................................................................................................................
Practice 6
10 Query the NAME_P and ZD_VALUE1_P columns of the ONRS_REGION table
to view the newly created values.
11 Configure your profile as before, so that it uses the TNSNAMES naming method
rather than ONAMES, and ensure that you can connect using the previously used
TNSNAMES naming method.
.....................................................................................................................................................
A-6 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix A: Practices
Practice 7
Start a Telnet session connecting to the server where your database resides.
1 Configure and start up the multithreaded server for your database so that you have
one dispatcher listening for TCP/IP connections and one shared server to serve
requests.
Specify the maximum dispatchers as two and maximum shared servers as six.
2 To verify that a dispatcher is associated with your listener, use the LSNRCTL
utility and issue the command: lsnrctl SERVICES your_listener_name.
3 Before making a connection, query the view V$CIRCUIT from SQL*Plus
connecting as system/manager in your Telnet session to see if it contains data.
This view has an entry for each connection session currently using the MTS.
4 Make a connection using SQL*Plus, connecting as system/manager from
your client to the server, and check V$CIRCUIT view again.
After you have verified the connection, exit SQL*Plus.
5 Do the following:
a Query the V$SHARED_SERVER view to see how many shared servers have
been started.
b Query the V$DISPATCHER view to see how many dispatchers have been
started.
6 Make two connections using SQL*Plus, connecting as system/manager from
your client to the server using MTS.
a Has the number of shared servers increased?
b Why or why not?
7 How could the number of shared servers increase?
8 Do the following:
a Add one more dispatchers to handle TCP requests.
b Verify that an additional dispatcher has been added.
c Decide whether you can add a third dispatcher.
9 Shut down your database and:
a Configure connection pooling so that the pooling takes effect when a third
connection is established.
b Verify that the connection pooling feature is working.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration A-7
.....................................................................................................................................................
Practice 8
Practice 8
Because of setup restrictions in the classrooms, you will be simulating the middle tier
by using your local machine. In a real-world environment, it is recommended to use a
multitier model.
Before starting this practice, make sure that you have no connections established to the
server side.
Start a Telnet session and connect to your server. Log in and check the usage of
sockets/ports by issuing the command netstat -a | grep your_client_name |
grep ESTABLISHED where your_client_name is the host name of your PC.
You should see something like:
netstat -a | grep wwedf-162 | grep ESTABLISHED
wwedf-162.us.oracle.com.v7dist33 8533 0 8760 0 ESTABLISHED
The output line will show the established connections from your client using the TCP
protocol.
This indicates the socket used by your Telnet session. If you get more than one line,
you have more than one connection established to the server.
In this lab, you will look at the socket usage when using the multiplexing feature of
Connection Manager.
1 On your local machine configure and start Connection Manager.
2 Edit your tnsnames.ora file, and add a service name entry that will use
Connection Manager to connect to the database on your server.
3 Test your service name by establishing two connections to the server using
SQL*Plus.
a From your Telnet session, check how many sockets you are now using.
b What explains the number of sockets used?
4 Exit your SQL*Plus sessions and verify that you just have one socket where a
connection is established.
5 From your Telnet session, shut down your database on the server and configure for
multiplexing.
6 Start up your database again and make two SQL*Plus connections from your
client.
a Check how many sockets you use now.
b What explains the number of sockets used?
c Close all the SQL*Plus sessions.
7 Do the following:
a Configure the Connection Manager so that your PC will not be restricted from
accessing any destination.
b Describe what happens when you try to connect.
8 Stop the Connection Manager, shut down the database server, and disable the
multithreaded server.
.....................................................................................................................................................
A-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix A: Practices
Practice 9
Before starting this practice, the instructor will provide you with a trace directory and
a log directory name.
1 Enable logging for your client. Specify the log directory and verify that the
sqlnet.ora file is correct.
You can either use Net8 Assistant or edit your sqlnet.ora file by hand.
2 Make a connection to the server using SQL*Plus, connecting as system/
manager. Will a log file be generated?
3 Shut down the listener on the server side, then try to connect, and finally
investigate the log file.
4 Start your listener again.
5 Enable tracing at SUPPORT level and make sure that the trace files have unique
names. You can do this either by using Net8 Assistant or by editing the
sqlnet.ora file.
6 Make a connection, exit the connection, and investigate the trace file.
7 Change directories to the assigned trace directory, and try running the Trace
Assistant utility using the -o option, send output to the file tst.txt, and then
investigate the file.
................................
Practice Solutions
B
.....................................................................................................................................................
B-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 3 Solutions
Before beginning this practice, your instructor should provide you with the server name
on which you will configure your listener and a port number on which your listener will
be listening. Throughout this practice, replace all the occurrences of nn with the number
assigned to you by the instructor.
1 Create a listener lsnrnn using Net8 Assistant on the client PC. The listener must be
configured for the server provided by the instructor; this server contains an Oracle
database Unn. The listener must also be configured for the TCP/IP protocol only
and must listen for incoming connections on the port provided by the instructor. Do
not configure the listener to use prespawned dedicated servers.
Note: For this classroom setup, the listener configuration file must be created on the
client PC using Net8 Assistant and, in later steps, transferred via FTP or similar file
transfer application on the server.
a From the Windows NT Start menu on the client PC, select Programs>Oracle -
Oracle Home>Network Administration>Net8 Assistant.
b Click the Listeners folder in Net8 Assistant.
c Select Create from the Edit menu item, or click the + icon.
d Enter a name for your listener (lsnrnn) in the Choose Listener Name dialog box
that appears and click OK.
The name of the newly created listener will appear below the Listeners folder in
the Net8 Assistant.
e Click the new listener name and select Listening Locations from the pull-down
menu on the right side of the screen in Net8 Assistant, if not already selected.
f Click the Add Address button.
A tab for the address details of the listener will appear.
g Select TCP/IP as the protocol, if not already selected.
h Enter the name of the server in the Host field, and the port number assigned for
your listener in the Port field (the Port number is provided by your instructor).
Leave the protocol stack support as the default value Net8 Clients.
i Select Database Services from the pull-down menu on the right side of the
screen in Net8 Assistant.
j Click the Add Database button.
A tab for the database on behalf of which the listener will listen for incoming
connections will appear.
k Enter a name for the global database in the Global Database Name field (the
Global Database Name is provided by your instructor).
l Enter the directory, defined as your $ORACLE_HOME directory on the server, in
the Oracle Home Directory field (Issue the env command from the UNIX
prompt to get the home directory).
m Enter your database system identifier (SID) (Unn) in the SID field.
n Save your configuration by selecting Save Network Configuration from the File
menu item in Net8 Assistant.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-3
.....................................................................................................................................................
Practice 3 Solutions
2 View the contents of the listener.ora file to verify the configuration details.
# C:\ORANT\NETWORK\ADMIN\LISTENER.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\listener.ora
# Generated by Oracle Net8 Assistant
LSNRnn =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<port>))
(PROTOCOL_STACK =
(PRESENTATION = TTC)
(SESSION = NS)
)
)
SID_LIST_LSNRnn =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Unn.world)
(ORACLE_HOME = <your_oracle_home_directory>)
(SID_NAME = Unn)
)
)
3 Transfer the listener configuration file from the client to the server using FTP or
any similar file transfer utility. The listener configuration file must be transferred
from the client to the directory on the server that will be searched for Net8
configuration files.
a Telnet and log on to the server.
b Type the env command from the UNIX prompt on the server to view the
environmental variables defined in your shell.
c Make a note of the directory path defined in the $TNS_ADMIN environment
variable.
d Transfer the listener.ora file from the client into this directory on the
server.
.....................................................................................................................................................
B-4 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
4 Manually add a parameter to the listener.ora file so that the listener creates a
log file called lsnrnn.log in the $TNS_ADMIN/log directory. If the log
directory does not exist in the $TNS_ADMIN directory, create it.
Note: This step is necessary for the classroom setup. If an entry for the listener log
file is not inserted into your listener.ora file, your listener will attempt to
write to the default listener log directory.
a Telnet and log on to the server.
b Change the directory to the $TNS_ADMIN directory.
$ cd $TNS_ADMIN
c If the log directory does not exist in this directory, create it with the following
command:
$ mkdir log
d Edit the listener.ora file in the $TNS_ADMIN directory and add the
following entry to it:
log_file_lsnrnn = <your_tns_admin_directory>/log/lsnrnn.log
5 Using the Listener Control utility, start your listener.
a Enter the following command after establishing a Telnet session to the Unn
account:
$ lsnrctl start lsnrnn
Starting /oracle/product/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 8.1.5.0.0 - Production
System parameter file is <tns_admin>/listener.ora
Log messages written to <tns_admin>/log/lsnrnn.log
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<
port>))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<
port>))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
STATUS of the LISTENER
------------------------
Alias lsnrnn
Version TNSLSNR for Solaris: Version 8.1.5.0.0
- Production
Start Date 15-JUL-99 13:17:48
Uptime 0 days 0 hr. 0 min. 0 sec
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-5
.....................................................................................................................................................
Practice 3 Solutions
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File <tns_admin>/listener.ora
Listener Log File <tns_admin>/log/lsnrnn.log
Services Summary...
Unn has 1 service handler(s)
The command completed successfully
6 View the contents of the listener log file.
a View the contents of the lsnrnn.log file in the $TNS_ADMIN/log directory.
7 Start up your database instance.
a Enter the following command to start the server:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> startup pfile=$HOME/LABS/initUnn.ora
ORACLE instance started.
Total System Global Area 6315408 bytes
Fixed Size 64912 bytes
Variable Size 5308416 bytes
Database Buffers 409600 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
.....................................................................................................................................................
B-6 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 4 Solutions
If you are unsure of the name of your client, please ask the instructor how to obtain the
name.
1 Using the local naming method in Net8 Assistant, configure the client side.
The protocol used is TCP/IP. The port number for the listener you should connect
to is the port number provided for the listener in the previous practice. SID is Unn.
Note: Use the Oracle8i Release 8.0 Database SID method to connect instead of the
Oracle8i Release 8.1 Service Name method.
a From the Windows NT menu bar, choose Start>Programs>Oracle -
Oracle Home>Network Administration>Net8 Assistant.
b From the Net8 Assistant menu, choose Net Service Names, and then select
Edit>Create, or click the + icon.
c In the Net Service Name Wizard window, enter your alias name for the address
that you want to connect to.
d Select the network protocol (TCP/IP) and click Next.
e Enter the host name (the name of the server that holds your database) and the
port number you have been assigned and click Next.
f Select Oracle8i Release 8.0 or Previous, and enter the system identifier (SID)
of the database to which you want to connect in the Service Name field, and
click Next.
g Select Finish.
h You will now return to the Net8 Assistant. Choose File >Save Network
Configuration.
2 Test that the service is operational.
a Test by using the test facility from Net8 Assistant or by connecting to the
server side using SQL*Plus from the client side.
Example:
c:\> sqlplus system/manager@Unn
where Unn is your service name
3 Investigate the contents of the tnsnames.ora file.
# C:\ORANT\NETWORK\ADMIN\TNSNAMES.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle Net8 Assistant
Unn =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <server_name>)(PORT =
<port>))
)
(CONNECT_DATA =
(SID = Unn)
)
)
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-7
.....................................................................................................................................................
Practice 4 Solutions
4 Connect to the server as system/manager using SQL*Plus and verify that you
are connected to the correct instance by querying the V$INSTANCE view. When
everything is working, have the group or person next to you edit your
tnsnames.ora file in order to provoke an error either by specifying a wrong port
to connect to or a wrong node name, database, or service name.
When they are done, try to correct the error by regenerating the tnsnames.ora
file by hand.
c:\> sqlplus system/manager@Unn
SQL*Plus: Release 8.1.5.0.0 - Production on Thu Jul 15 18:34:46
1999
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Objects options
PL/SQL Release 8.1.5.0.0 - Production
SQL> select instance_name, version, startup_time, status
2 from v$instance;
INSTANCE_NAME VERSION STARTUP_T STATUS
--------------- ----------------- --------- -------
DB01 8.1.5.0.0 02-AUG-99 OPEN
5 Using Net8 Assistant, configure your client to make connections to the listener on
the server using the new service name instead of the instance name.
Hint: Use Oracle8i release 8.1compatible identification.
a From the Windows NT menu bar, choose Start>Programs>Oracle -
Oracle Home>Network Administration>Net8 Assistant.
b From the Net8 Assistant menu, double-click Net Service Names and choose
the service name you just created.
c In the right window, deselect the Use Oracle8 8.0 Compatible Identification
check box.
The Service Name field will be highlighted.
d Enter the database name with the domain name as follows:
Unn
e Save the network configuration.
Browse the contents of the tnsnames.ora file.
# C:\ORANT\NETWORK\ADMIN\TNSNAMES.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\tnsnames.ora
# Generated by Oracle Net8 Assistant
Unn =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <server_name>)(PORT =
<port>))
)
.....................................................................................................................................................
B-8 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
(CONNECT_DATA =
(SERVICE_NAME = Unn)
)
)
6 Connect to the server as system/manager using SQL*Plus and verify that you
are connected to the correct instance as was done in step 4.
7 Shut down the database instance and the listener, and configure your database
instance (Unn) for automatic instance registration.
Hint: Look at the parameters SERVICE_NAMES and INSTANCE_NAME in the
initSID.ora file.
a Enter the following command to shut down the server:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
b Enter the following command to stop the listener:
$ lsnrctl stop lsnrnn
c Edit the initSID.ora file and find the service name and instance name
parameter.
d Enter the following parameters if they have not already been entered by the
installation:
INSTANCE_NAMES=Unn
SERVICE_NAMES=Unn
e Enter the following command to start the server:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> startup pfile=$HOME/LABS/initUnn.ora
ORACLE instance started.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-9
.....................................................................................................................................................
Practice 4 Solutions
Total System Global Area 6315408 bytes
Fixed Size 64912 bytes
Variable Size 5308416 bytes
Database Buffers 409600 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
8 Check that the instance has been registered and which listener has the handle.
a Enter the following command to check the default listener:
$ lsnrctl services
LSNRCTL for Solaris: Version 8.1.5.0.0 - Production on 12-AUG-
99 13:26:45
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connecting to
(DESCRIPTION=(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS))
(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=1521)))
Services Summary...
Unn has 1 service handler(s)
DEDICATED SERVER established:0 refused:0
LOCAL SERVER
Unn has 1 service handler(s)
DEDICATED SERVER established:0 refused:0
LOCAL SERVER
The command completed successfully
b The default listener listening on port 1521 has the handle to the Unn database.
9 Restart the database and have it register with your working listener lsnrnn.
Hint: Look at the parameters LOCAL_LISTENER in the initSID.ora file.
Create a new tnsnames.ora manually. Do not use the Net8 Assistant.
a Enter the following command to shut down the server:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
.....................................................................................................................................................
B-10 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
b Edit your listener.ora file to make sure it does not contain the
SID_LIST_LSNRnn parameter.
c Enter the following to stop your listener:
$ lsnrctl stop lsnrn
d Enter the following command to start your listener:
$ lsnrctl start lsnrnn
e Enter the following parameter in your initSID.ora file:
LOCAL_LISTENER=<listener_name>
f Create a new tnsnames.ora file with the following content:
listener_name=
(description=
(address=
(protocol=tcp)
(host=<server_name>)
(port=<port>)))
g Enter the following command to start the server:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> startup pfile=$HOME/LABS/initUnn.ora
ORACLE instance started.
Total System Global Area 6315408 bytes
Fixed Size 64912 bytes
Variable Size 5308416 bytes
Database Buffers 409600 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
h Check to make sure your instance has registered with your working listener
and not the default listener on port 1521.
$ lsnrctl status lsnrnn
LSNRCTL for Solaris: Version 8.1.5.0.0 ... 12-AUG-99 14:20:36
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wwed165-
sun)(PORT=1534))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-11
.....................................................................................................................................................
Practice 4 Solutions
STATUS of the LISTENER
------------------------
Alias lsnrnn
Version TNSLSNR for Solaris: Version 8.1.5.0.0
- Production
Start Date 12-AUG-99 14:19:05
Uptime 0 days 0 hr. 1 min. 30 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /oracle/net8i/listener.ora
Listener Log File /oracle/net8i/log/lsnrnn.log
Services Summary...
Unn has 1 service handler(s)
The command completed successfully
.....................................................................................................................................................
B-12 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 6 Solutions
1 Create a Names server on your local PC node and view the contents of the Names
configuration file. Do not configure the Names server with a region database. Use
1575 as the port on which the Names server will accept incoming name resolution
requests. Make sure the DB_DOMAIN parameter is set to NULL.
Note: In this class, the Names server is created on your local PC node; therefore,
your node will act as a client as well as a Names server. Ideally, a Names server
should reside on a dedicated middle-tier node on the network.
Bring up the DOS box and enter hostname to determine the name of your client
PC.
a Click the Oracle Names Servers icon in Net8 Assistant.
b Click the OK button when the message dialog appears.
c Select Create from the Edit menu item, or click the + icon.
d This will start up the Names Wizard. Follow the instructions of the Names
Wizard closely.
e Click the Next button to continue reading the wizard instructions.
f Enter a name for the Names server <your_names_server_name> and click the
Next button.
g Enter the host name of your client machine, and a port number (1575) assigned
for the Names server.
Note: Enter hostname at the DOS prompt to determine the name of the client
PC.
h Click Next to follow the wizard instructions.
i Select the Dont Use a Region Database option button and click Next.
j Select the Names Server Is First in Its Region option button and click Next.
k Click the Yes option button for the Names server being in the root region and
click Next.
l Click the Finish button.
m Click OK when the dialog box appears indicating a successful Names server
creation.
n Browse the contents of the names.ora file located in the
$ORACLE_HOME\network\admin directory on the client:
# C:\ORANT\NETWORK\ADMIN\NAMES.ORA Configuration
# File:c:\orant\NETWORK\ADMIN\names.ora
# Generated by Oracle Net8 Assistant
NAMES.SERVER_NAME = <names_server_name>
NAMES.ADDRESSES =
(ADDRESS = (PROTOCOL = TCP)(HOST = <client_machine>)(PORT =
1575))
o Save the network configuration.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-13
.....................................................................................................................................................
Practice 6 Solutions
p Select Discover Oracle Names Servers from the Command menu item. This
will take some time. Click Cancel when the dialog box appears indicating that
no Names server was discovered.
q Click OK at the dialog box.
2 Start up the Names server, and add a service name for the database Unn to the
Names server. Use the attributes for the database service name defined in your
existing tnsnames.ora file.
Note: Do not use Oracle8i release 8.0compatible identification to connect
a Select Manage Server from the pull-down menu.
b Select the Start button if it has not already been selected.
c Click the Apply button.
d This should start the Names server process. Click OK at the dialog box.
e Select Manage Data from the pull-down menu.
f Click the Add button.
g Enter a service name to this Names server by entering the host name of the
service and the port number the listener is on. Get this information from your
existing tnsnames.ora file.
h Verify that the SID, Protocol, and Host Name values are correct.
i Deselect the Use Oracle8i Release 8.0 Compatible Identification check box.
j Enter the service name (Unn).
k Click the Execute button.
The bottom left corner should display a status of Operation complete.
3 Using Net8 Assistant, configure your client profile to use Oracle Names, and
assign the previously created Names server as the preferred Names server for your
client profile.
a Start up Net8 Assistant.
b Click the Profile folder icon.
c Select Naming from the pull-down menu, if not already selected.
d Click the Methods tab.
e Add ONAMES to the Selected Methods, if it has not already been selected.
f Select Preferred Oracle Names Servers from the pull-down menu.
g Click the New button.
h Select TCP as the protocol.
i Enter the host name of the preferred Names server (Your client machines host
name in this case).
j Enter the port number at which the Names server is listening for incoming
requests. You can get this from the existing names.ora file.
k Save the network configuration from the File menu item.
.....................................................................................................................................................
B-14 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
4 Connect to Unn using SQL*Plus and verify if the Names server is operational by
using ONAMES as the only naming method.
a Start up SQL*Plus and connect to Unn using the existing tnsnames.ora file.
b Remove all other naming methods except ONAMES.
c Save the network configuration.
d Start up SQL*Plus and connect to Unn again.
5 Using the Windows Control panel, shut down the Names server. After the Names
server is shut down, perform the following functions using the Names Control
utility:
Double-click the Services icon from the Windows Control Panel, and stop the
Oracle<Oracle Home>Names<names_server_name> service.
a View the status of the Names server by using the Names Control Utility.
At the DOS prompt, enter namesctl to use the Names Control utility, and
enter the following to view the status of the Names server:
NAMECTL> status
b What is the error message, and why does it occur?
The following error message occurs:
NNL-00005: no server has been set. Use the SET SERVER command first
This error occurs because the Names Control utility does not set the Names
server. It has to be set manually using the SET SERVER command.
c Set the server to the Names server that you previously configured.
Enter the following to set the server to the current Names server:
NAMECTL> set server
(address=(protocol=tcp)(host=<server>)(port=<port>))
Note: This address can be taken from the names.ora file.
d What is the error message, and why does it occur?
NNC-00003: error opening stream
(address=(protocol=tcp)(host=<server>)(port=<port>))
This error occurs because the Names server has not been started. The SET
SERVER command and the STATUS command both require that the Names
server be running.
e Start up the Names server.
Issue the following command to start up the Names server:
NAMECTL> start
(address=(protocol=tcp)(host=<server>)(port=<port>))
or
NAMECTL> start
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-15
.....................................................................................................................................................
Practice 6 Solutions
6 If you do not plan to attempt the optional practice, configure your profile as before,
so that it uses the TNSNAMES naming method rather than ONAMES.
a Click the Profile icon and select Naming from the pull-down menu.
b Click the Methods tab and select TNSNAMES only.
c Save the network configuration.
Optional Practice
7 Ensure that the Names server is running. Restart the Net8 Assistant utility, then
reconfigure your Names server to use a region database. The region database
should now reside on the Unn database on the server, while the Names server still
resides on the client. Use the SYSTEM user to run the Names server initialization
script (Typically you would use a separate user for this purpose).
Note: Do not use Oracle8i Release 8.0compatible identification when
connecting.
a Use SQL*Plus to connect to the Unn server as SYSTEM, using the previously
configured Names server.
b Run the Names server initialization file
$ORACLE_HOME\network\names\namesini.sql on Unn.
SQL> @$ORACLE_HOME\network\names\namesini.sql
c Restart the Net8 Assistant utility.
d Double-click the Oracle Names Servers icon.
e Click the previously configured Names server listed under the Oracle Names
Servers icon.
f From Net8 Assistant, select Configure Server from the pull-down menu for the
current Names server.
g Click the Database tab.
h Select the Region Database option button.
i Enter the host name and port number of the Unn server, which will maintain
the region database.
Note: The port number should be that at which the listener of the server is
listening at for incoming connections, usually port 1521.
j Deselect the Use Oracle8i Release 8.0Compatible Identification check box.
k Enter the Unn as the Service Name of the database that will store the region
information.
l Enter the username and password into the new region database. (Use the
SYSTEM username and password provided by your instructor.)
m Save the network configuration.
n Restart the Names server.
.....................................................................................................................................................
B-16 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
8 Add a service name for Unn to the newly created region database on Unn itself.
Note: Use a different service name with the same connection attributes.
a Select Manage Data from the pull-down menu.
b Click the Add button.
c Enter a different service name with the same host name and port of the Unn
database in the appropriate fields.
d Verify that the Service Name, Protocol, and Server Type values are correct.
e Click Execute.
9 Attempt to connect to Unn using SQL*Plus after the service name is added.
Start up SQL*Plus and connect to Unn.
10 Query the NAME_P and ZD_VALUE1_P columns of the ONRS_REGION table
to view the newly created values.
From the SQL prompt, enter the following SQL statement to list the connection
strings stored in the region database:
SQL> col name_p format a15;
SQL> col zd_value1_p format a40;
SQL> select name_p, zd_value1_p from onrs_region;
NAME_P ZD_VALUE1_P
------------ ----------------------------------------
(DATA_LIST=(FLAGS=0x11)(DATA=(TYPE=ns.sm
d.)(NAME=name_svr01.)))
name_svr01 (DATA_LIST=(FLAGS=0x9)(DATA=(TYPE=a.smd.
)(ADDRESS = (PROTOCOL = TCP)(HOST = hras
muss-lap)(PORT = 1575))))
name_svr01 (DATA_LIST=(FLAGS=0x9)(DATA=(TYPE=tos.np
d.omd.)(CTEXT=ORACLE_NAMESERVER)))
name_svr01 (DATA_LIST=(FLAGS=0x9)(DATA=(TYPE=host.n
m.omd.)(TEXT=hrasmuss-lap)))
hannes_data
hannes_data (DATA_LIST=(FLAGS=0x1)(DATA=(TYPE=a.smd.
)(DESCRIPTION=(SOURCE_ROUTE=OFF)(ADDRESS
_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=wwed1
65-sun)(PORT=1534)))(CONNECT_DATA=(SERVI
CE_NAME=DB01)(SRVR=dedicated)))))
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-17
.....................................................................................................................................................
Practice 6 Solutions
11 Configure your profile as before, so that it uses the TNSNAMES naming method
rather than ONAMES, and ensure that you can connect using the previously used
TNSNAMES naming method.
a Click the Profile icon and select Naming from the pull-down menu.
b Click the Methods tab and select TNSNAMES only.
c Save the network configuration.
d Connect to the Unn server using SQL*Plus.
.....................................................................................................................................................
B-18 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 7 Solutions
Start a Telnet session connecting to the server where your database resides.
1 Configure and start up the multithreaded server for your database so that you have
one dispatcher listening for TCP/IP connections and one shared server to serve
requests.
Specify the maximum dispatchers as two and maximum shared servers as six.
a Modify the initUnn.ora to have the following entries:
# Multithreaded Server Environment
mts_dispatchers=(PRO=TCP)(DIS=1)
mts_servers = 1
mts_max_dispatchers = 2
mts_max_servers = 6
b Start up the database:
$ sqlplus / as sysdba
SQL*Plus: Release 8.1.5.0.0 - Production on Mon Aug 2 16:06:53
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 - Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> startup pfile=$HOME/LABS/initUnn.ora
ORACLE instance started.
Total System Global Area 6315408 bytes
Fixed Size 64912 bytes
Variable Size 5308416 bytes
Database Buffers 409600 bytes
Redo Buffers 532480 bytes
Database mounted.
Database opened.
2 To verify that a dispatcher is associated with your listener use the LSNRCTL
utility, and issue the command: lsnrctl SERVICES your_listener_name.
$ lsnrctl services lsnrnn
LSNRCTL for Solaris: Version 8.1.5.0.0 - Production on 16-JUL-99
17:24:35
(c) Copyright 1998 Oracle Corporation. All rights reserved.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-19
.....................................................................................................................................................
Practice 7 Solutions
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<por
t>))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Services Summary...
Unn has 3 service handler(s)
DEDICATED SERVER established:8 refused:0
LOCAL SERVER
DEDICATED SERVER established:0 refused:0
LOCAL SERVER
DISPATCHER established:0 refused:0 current:0 max:254
state:ready
D000 <machine: <server_name>, pid: 2983>
(ADDRESS=(PROTOCOL=tcp)(HOST=<server_name>)(PORT=53064))
The command completed successfully
3 Before making a connection, query the view V$CIRCUIT from SQL*Plus
connecting as system/manager in your Telnet session to see if it contains data.
This view has an entry for each connection session currently using the MTS.
$ sqlplus system/manager
SQL*Plus: Release 8.1.5.0.0 - Production on Fri Jul 16 17:28:02
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
Oracle8i Enterprise Edition Release 8.1.5.0.0 -Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> select circuit, status from v$circuit;
no rows selected
4 Make a connection using SQL*Plus, connecting as system/manager from your
client to the server, and check V$CIRCUIT view again.
After you have verified the connection, exit SQL*Plus.
a Connect from SQL*Plus.
c:\> sqlplus system/manager@Unn
b Check that you have a connection using MTS.
SQL> select circuit, status from v$circuit;
CIRCUIT STATUS
-------- ----------------
801E58D0 NORMAL
The entry in V$CIRCUIT indicates that you have a connection using MTS.
.....................................................................................................................................................
B-20 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
5 Do the following:
a Query the V$SHARED_SERVER view to see how many shared servers have
been started. You will see that just one shared server has been started.
SQL> select name, status, circuit from v$shared_server;
NAME STATUS CIRCUIT
---- ---------------- --------
S000 EXEC 801E58D0
b Query the V$DISPATCHER view to see how many dispatchers have been
started. You will see that one dispatcher for TCP has been started.
SQL> select name, status from v$dispatcher;
NAME STATUS
---- ----------------
D000 WAIT
6 Make two connections using SQL*Plus, connecting as system/manager from
your client to the server using MTS.
a Has the number of shared servers increased?
SQL> select name, status, circuit from v$shared_server;
NAME STATUS CIRCUIT
---- ---------------- --------
S000 EXEC 801E58D0
The number of shared servers has not increased.
b Why or why not?
The number of shared servers has not increased because they are shared
among several connections established through the dispatcher.
7 How could the number of shared servers increase?
The only way that the number of shared servers will increase is if multiple requests
must be handled at the same time and there are not enough shared servers to handle
the requests.
Shared servers can be allocated dynamically up to the number specified by
MTS_MAX_SERVERS.
Exit your SQL*Plus connections.
8 Do the following:
a Add one more dispatchers to handle TCP requests.
SQL> alter system set mts_dispatchers=(PRO=TCP)(DIS=2);
System altered.
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-21
.....................................................................................................................................................
Practice 7 Solutions
b Verify that an additional dispatcher has been added.
SQL> select name, status from v$dispatcher;
NAME STATUS
---- ----------------
D000 WAIT
D001 WAIT
c Decide whether you can add a third dispatcher.
No, because the initUnn.ora parameter MTS_MAX_DISPATCHERS is set
to 2.
9 Shut down your database
a Configure connection pooling so that the pooling takes effect when a third
connection is established.
In your initUnn.ora file specify the following:
mts_dispatchers=
"(PRO=TCP)(DIS=1)(POO=ON)(CON=1)(SESS=3)(TIC=6)"
mts_servers = 1
Note that SESS is set to 3 because of a bug that computes CON to CON+1. If
SESS is set to 2 and CON also is equal to 2, then the third connection would be
established via a dedicated server.
b Verify that the connection pooling feature is working.
Start up the database and start three SQL*Plus connections from your client to
your server. You will see that the third connection will hang for up to 60
seconds before being logged on.
.....................................................................................................................................................
B-22 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 8 Solutions
Because of setup restrictions in the classrooms, you will be simulating the middle tier
by using your local machine. In a real-world environment, it is recommended to use a
multitier model.
Before starting this practice, make sure that you have no connections established to the
server side.
Start a Telnet session and connect to your server. Log in and check the usage of
sockets/ports by issuing the command netstat -a | grep your_client_name |
grep ESTABLISHED where your_client_name is the host name of your PC.
You should see something like:
netstat -a | grep wwedf-162 | grep ESTABLISHED
wwedf-162.us.oracle.com.v7dist33 8533 0 8760 0 ESTABLISHED
The output line will show the established connections from your client using the TCP
protocol.
This indicates the socket used by your Telnet session. If you get more than one line,
you have more than one connection established to the server.
In this lab, you will look at the socket usage when using the multiplexing feature of
Connection Manager.
1 On your local machine configure and start Connection Manager.
a cman.ora file:
# Connection Manager config file cman.ora
# cmans listening addresses
cman = (ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=<client_name>)(PORT=1610)))
b From a DOS prompt:
c:\> cmctl
CMCTL for 32-bit Windows: Version 8.1.5.0.0 - Production on 16-
JUL-99 11:39:48
(c) Copyright 1998 Oracle Corporation. All rights reserved.
CMCTL> start cm
Service Oracle<Oracle Home>Cman start pending.
Service Oracle<Oracle Home>Cman started.
CMAN Status:
(STATUS=(VERSION=8.1.5.0.0)(STARTED=08-JUL-99
12:13:04)(STATE=running))
CMCTL> exit
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-23
.....................................................................................................................................................
Practice 8 Solutions
2 Edit your tnsnames.ora file, and add a service name entry that will use
Connection Manager to connect to the database on your server.
tnsnames.ora file:
Unn =
(DESCRIPTION=(address_list=
(ADDRESS=
(PROTOCOL=tcp)(PORT=1610)(HOST=<client_name>))
(ADDRESS=
(PROTOCOL=tcp)(PORT=<port>)(HOST=<server_name>)))
(CONNECT_DATA=(SERVICE_NAME=Unn))
(SOURCE_ROUTE=no)
)
3 Test your service name by establishing two connections to the server using
SQL*Plus.
a From your Telnet session, check how many sockets you are now using.
/dbaclass7/dba20> netstat -a | grep <your_client> | grep
ESTABLISHED
<your_client>.DBA09_LI 7793 0 8760 0 ESTABLISHED
<your_client>.DBA20_LI <your_client>.1850 7549 0 8760
0 ESTABLISHED
<your_client>.DBA20_LI <your_client>.1853 7549 0 8760
0 ESTABLISHED
b What explains the number of sockets used?
There are now three sockets in use: one for the Telnet session and one for each
of the SQL*Plus network sessions. Note that you have not yet configured for
the multiplexing on the server side.
4 Exit your SQL*Plus sessions and verify that you just have one socket where a
connection is established.
/dbaclass7/dba20> netstat -a | grep wwedf-162 | grep ESTABLISHED
wwedf-162.us.oracle.com.DBA09_LI 7793 0 8760 0
ESTABLISHED
5 From your Telnet session, shut down your database on the server and configure for
multiplexing.
$ sqlplus system/manager
SQL*Plus: Release 8.1.5.0.0 - Production on Fri Jul 16 17:28:02
1999
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connected to:
.....................................................................................................................................................
B-24 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Oracle8i Enterprise Edition Release 8.1.5.0.0 -Production
With the Partitioning and Java options
PL/SQL Release 8.1.5.0.0 - Production
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
Modify the initUnn.ora file to have the following entries:
# Multithreaded Server Environment
mts_dispatchers=(PRO=TCP)(MUL=ON)(DIS=1)
mts_servers = 1
6 Start up your database again and make two SQL*Plus connections from your
client.
a Check how many sockets you use now.
/dbaclass7/dba20> netstat -a | grep <client_name> | grep
ESTABLISHED
<client_name>.us.oracle.com.DBA09_LI 7793 0 8760 0
ESTABLISHED
<server_name>.DBA20_LI <client_name>.us.oracle.com.1850 7549
0 8760 0 ESTABLISHED
b What explains the number of sockets used?
There are now just two sockets in use: one for the Telnet session and one for
the two SQL*Plus network sessions. There are two sockets in use because of
the multiplexing feature that now is enabled.
c Close all the SQL*Plus sessions.
7 Do the following:
a Configure the Connection Manager so that your PC will not be restricted from
accessing any destination.
Add the entry in your cman.ora configuration file.
cman_rules = (rule_list=
(rule=(src=<client_name>)(dst=x)(srv=x)(act=REJ)))
Stop and start the Connection Manager again.
c:\> cmctl
CMCTL for 32-bit Windows: Version 8.1.5.0.0 - Production on 16-
JUL-99 11:39:48
(c) Copyright 1998 Oracle Corporation. All rights reserved.
CMCTL> stop cm
CMCTL> start cm
Service Oracle<Oracle Home>Cman start pending.
Service Oracle<Oracle Home>Cman started.
CMAN Status:
(STATUS=(VERSION=8.1.5.0.0)(STARTED=16-JUL-99
12:13:04)(STATE=running))
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-25
.....................................................................................................................................................
Practice 8 Solutions
CMCTL> exit
b Describe what happens when you try to connect.
SQL*Plus: Release 8.1.5.0.0 - Production on Fri Jul 16 11:11:35
1998
(c) Copyright 1999 Oracle Corporation. All rights reserved.
ERROR:
ORA-12204: TNS:received data refused from an application
8 Stop the Connection Manager, shut down the database server, and disable the
multithreaded server.
.....................................................................................................................................................
B-26 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
Practice 9 Solutions
Before starting this practice, the instructor will provide you with a trace directory and
a log directory name.
1 Enable logging for your client. Specify the log directory and verify that the
sqlnet.ora file is correct.
You can either use Net8 Assistant or edit your sqlnet.ora file by hand.
sqlnet.ora:
# C:\ORANT8\NETWORK\ADMIN\SQLNET.ORA Configuration
# File:C:\ORANT8\NETWORK\ADMIN\sqlnet.ora
# Generated by Oracle Net8 Assistant
LOG_FILE_CLIENT = net
LOG_DIRECTORY_CLIENT = c:\orant\network\log
SQLNET.EXPIRE_TIME = 0
NAMES.DIRECTORY_PATH = (TNSNAMES)
Note: If the Net8 Assistant is used to create the file above, you must simply use
net as the file name, and Net8 Assistant will append .log to the end of the file.
2 Make a connection to the server using SQL*Plus, connecting as system/
manager. Will a log file be generated?
No log file is generated, because no errors occurred.
3 Shut down the listener on the server side, then try to connect, and finally
investigate the log file.
a $ lsnrctl stop lsnr02
LSNRCTL for Solaris: Version 8.1.5.0.0 - Production on 16-JUL-
99 19:37:07
(c) Copyright 1998 Oracle Corporation. All rights reserved.
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=wwed165-
sun)(PORT=1521))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
The command completed successfully
b c:> sqlplus system/manager@Unn
SQL*Plus: Release 8.1.5.0.0 - Production on Fri Jul 16 20:06:15
1999
(c) Copyright 1999 Oracle Corporation. All rights reserved.
ERROR:
ORA-12541: TNS:no listener
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration B-27
.....................................................................................................................................................
Practice 9 Solutions
c From net.log:
******************************************************************
Fatal NI connect error 12541, connecting to:
(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=wwed165
-
sun)(PORT=1610)))(CONNECT_DATA=(SERVICE_NAME=PROD.world)(CID=(P
ROGRAM=C:\orant\BIN\SQLPLUSW.EXE)(HOST=SHKHAN-
LAP)(USER=shkhan))))
VERSION INFORMATION:
TNS for 32-bit Windows: Version 8.1.5.0.0 - Production
Windows NT TCP/IP NT Protocol Adapter for 32-bit Windows:
Version 8.1.5.0.0 - Production
Time: 16-JUL-99 20:15:07
Tracing not turned on.
Tns error struct:
nr err code: 0
ns main err code: 12541
TNS-12541: TNS:no listener
ns secondary err code: 12560
nt main err code: 511
TNS-00511: No listener
nt secondary err code: 61
nt OS err code: 0
4 Start your listener again.
$ lsnrctl start lnsrnn
Starting /oracle/product/bin/tnslsnr: please wait...
TNSLSNR for Solaris: Version 8.1.5.0.0 - Production
System parameter file is /oracle/product/network/admin/
listener.ora
Log messages written to /oracle/product/network/log/lsnr02.log
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<por
t>))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<server_name>)(PORT=<por
t>))
(PROTOCOL_STACK=(PRESENTATION=TTC)(SESSION=NS)))
.....................................................................................................................................................
B-28 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix B: Practice Solutions
STATUS of the LISTENER
------------------------
Alias lsnrnn
Version TNSLSNR for Solaris: Version 8.1.5.0.0 -
Production
Start Date 16-JUL-99 19:47:06
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security OFF
SNMP OFF
Listener Parameter File /oracle/product/network/admin/
listener.ora
Listener Log File /oracle/product/network/log/lsnr02.log
Services Summary...
Unn has 1 service handler(s)
The command completed successfully
5 Enable tracing at SUPPORT level and make sure that the trace files have unique
names. You can do this either by using Net8 Assistant or by editing the
sqlnet.ora file.
Investigate the sqlnet.ora file:
TRACE_DIRECTORY_CLIENT = c:\orant\network\trace
TRACE_FILE_CLIENT = net
TRACE_LEVEL_CLIENT = SUPPORT
SQLNET.EXPIRE_TIME = 0
NAMES.DIRECTORY_PATH= (TNSNAMES)
6 Make a connection, exit the connection, and investigate the trace file.
7 Change directories to the assigned trace directory, and try running the Trace
Assistant utility using the -o option, send output to the file tst.txt, and then
investigate the file.
C:\ORANT\NETWORK\trace>trcasst -o net.trc > tst.txt
C:\ORANT8\NET80\ADMIN\trace>edit tst.txt
................................
Configuring External
Procedures
C
.....................................................................................................................................................
C-2 Enterprise DBA Part 3: Network Administration
.....................................................................................................................................................
Appendix C: Configuring External Procedures
Configuring External Procedures
External Procedures
External procedures are configured in the listener.ora and tnsnames.ora
configuration files. An external procedure is a third-generation-language routine stored
in a shared library, or a Java class method stored in a lib unit. This makes the strengths
and capabilities of those languages available to you. The routine must be called from
Java or C, but can be written in any language. The external procedure is registered with
PL/SQL so that it can be called from a PL/SQL program.
Typically, external procedures are used to:
Interface with:
Pre-developed application code
Third-party routines
Embedded systems
Solve scientific and engineering problems
Analyze data
Control real-time devices and processes
For example, you can use external procedures to send instructions to a robot, solve
partial differential equations, process signals, analyze time series, or create animation
on a video display.
3-14 Copyright Oracle Corporation, 1999. All rights reserved.
External procedure
Configuring External Procedures
PL/SQL
subprogram
External procedures enable you to make callouts
and optionally, callbacks through PL/SQL
.....................................................................................................................................................
Enterprise DBA Part 3: Network Administration C-3
.....................................................................................................................................................
Configuring External Procedures
Executing External Procedures
When the external procedure is invoked, PL/SQL loads the library dynamically and
calls the external procedure as if it were a PL/SQL subprogram. A server process
executes the PL/SQL subprogram that is registered as an external procedure.
1 The server process looks up the alias library to get the operating system filename.
The alias library is created in the Oracle database with the CREATE
LIBRARY command.
The user must be granted the execute privilege on the library to call the
external procedure.
2 The server process passes the request to the listener. The tnsnames.ora file
includes the information needed by the server to make the connection to the
external process.
3 The listener process spawns the extproc process. The listener.ora file
includes the information needed by the listener to start the process. The extproc
process remains active for that user until the user logs off. Because the external
procedure runs in a separate address space, it cannot cause damage to the database.
For example, it cannot write into the Oracle address space.
4 The extproc process loads the shared library.
5 The extproc process executes the external procedure, which participates fully in
the current transaction. The external procedure can call back to the database to do
SQL operations and can return results to the PL/SQL subprogram.
3-15 Copyright Oracle Corporation, 1999. All rights reserved.