Net8 Administrator's Guide
Release 8.1.6

Part Number A76933-01

Library

Product

Contents

Index

Go to previous page Go to next page

11
Establishing a Connection and Testing the Network

Once you have completed configuring your network, you should make a connection and test each component to ensure that the network is functioning properly. Net8 provides a variety of tools to help you start, test, and control an Oracle Names server, listener, and Oracle Connection Manager.

This chapter outlines procedures to make a connection and test network components using control utilities. This chapter contains the following sections:

Connecting to a Database

Connecting to a database involves starting network components and entering a connect string with a net service name, such as

CONNECT username/password@connect_identifier

This section covers the following topics:

Using Net8 Control Utilities

Net8 provides the following tools to help you start, test and control each network component.

Using the Oracle Names Control Utility (NAMESCTL)

The Oracle Names Control Utility, NAMESCTL, is a tool that you run from the operating system prompt to start and control the Oracle Names server.

The general form of the Oracle Names Control Utility is:

NAMESCTL command 

You can also issue NAMESCTL commands at the program prompt. When you enter NAMESCTL on the command line, the program is opened. You can then enter the desired commands from the program prompt. For example, the following command starts the Oracle Names server.

NAMESCTL> start 

Using the Listener Control Utility (LSNRCTL)

The Listener Control Utility, LSNRCTL, is a tool that you run from the operating system prompt to start and control the listener. The general form of the Listener Control Utility is:

LSNRCTL command [listener_name] [args]

You can also issue Listener Control Utility commands at the program prompt. When you enter LSNRCTL on the command line, the program is opened. You can then enter the desired commands from the program prompt. For example, the following command determines the amount of time in seconds the listener will wait for a valid connection request after a connection has been started.

LSNRCTL> set connect_timeout 20

Using the Connection Manager Control Utility (CMCTL)

The Connection Manager Control Utility, CMCTL, is a tool that you run from the operating system prompt to start and control Oracle Connection Manager. The general form of the Connection Manager Control Utility is:

CMCTL command 

You can also issue CMCTL commands at the program prompt. When you enter CMCTL on the command line, the program is opened. You can then enter the desired commands from the program prompt. For example, the following command starts Oracle Connection Manager.

CMCTL> start 

Net8 Component Startup Overview

Client workstations and other servers connect to a listener with a net service name when logging onto an Oracle server.

After installing and configuring all the network components, you need to start them to make the network functional. Following is an outline of the steps you should take to start the network components.

Task 1: Start Oracle Names Servers

Task 2: Start Oracle Names Client Cache

Task 3: Start the Listener

Task 4: Start the Database

Task 5: Start Oracle Connection Manager


Note:

If the Oracle Names servers use a database to store the network information, you need to start the database first, then start the listener. 


Task 1: Start Oracle Names Servers

Start Oracle Names servers using either Net8 Assistant or the NAMESCTL control utility on the machines where Oracle Names server software is installed and configured:

Use the NAMESCTL Control Utility  Use Net8 Assistant 

From the command line, enter:

NAMESCTL

NAMESCTL> start

The START command of NAMESCTL loads the Oracle Names server into memory and tells it to begin executing. At startup, the Oracle Names server loads its configuration and data. 

  1. Start Net8 Assistant.

    -On UNIX, run netasst at $ORACLE_HOME/bin.

    -On Windows NT, choose Start > Programs > Oracle - HOME_NAME > Network Administration > Net8 Assistant.

  2. In the navigator pane, expand the Oracle Names server folder.

  3. Select the Oracle Names server.

  4. From the list in the right pane, select Manage Server from the list box.

  5. Click the Control tab.

  6. Click the Start radio button from the Server Operations field.

  7. Click Apply.

 

On Windows NT, an Oracle Names server may also be started through the Control Panel:

  1. Double-click the Services icon in the Control Panel window.

  2. Select the OracleHOME_NAMENamesonames_serverService service.

  3. Click Start to start the service.

  4. In the Services window, click Close.

Task 2: Start Oracle Names Client Cache

To avoid clients looking up address information in an Oracle Names server each time, create a client cache of the information. This information is stored in ckpcch.ora file located by default in $ORACLE_HOME/network/names on UNIX and ORACLE_HOME\network\names on Windows platforms.

To create a client cache:

  1. Ensure discovery of Oracle Names servers has been performed, as described in "Task 4: Configure Clients and Database Servers To Use Oracle Names Servers". The information gathered during discovery is used for a client's cache.

  2. Create and start the client cache on the client:

    NAMESCTL
    NAMESCTL> start_client_cache
    
    

On Windows NT, the client cache may also be started through the Control Panel:

  1. Double-click the Services icon in the Control Panel window.

  2. Select the OracleHOME_NAMEClientCache service.

  3. Click Start to start the service.

  4. In the Services window, click Close.

Task 3: Start the Listener

For Net8 to accept connections on the server, a listener must be started with the LSNRCTL control utility on the server:

  1. From the command line enter:

    LSNRCTL
    LSNRCTL> status [listener_name]
    
    

    where listener_name is the name of the listener defined in the listener.ora file. It is not necessary to identify the listener if you are using the default listener, named LISTENER.

    If the STATUS command indicates that the listener is running, go to Step 2. If the listener is not running, go to Step 3.

    Even if the listener is running, Oracle Corporation advises you to stop the listener, and start it again. To stop the listener, enter:

    LSNRCTL> set password password
    LSNRCTL> stop [listener_name]
    
    

    SET PASSWORD is only required if the password is set in the listener.ora file. The password defaults to ORACLE.

  2. Start the listener. Enter:

    LSNRCTL> start [listener_name]
    
    

    LSNRCTL will display a status message indicating that the listener has started successfully. Check that all expected services for that listener are listed in the services summary in the status message.

  3. Exit from the LSNRCTL utility. Enter:

    LSNRCTL> exit
    
    

On Windows NT, the listener may also be started through the Control Panel:

  1. Double-click the Services icon in the Control Panel window.

  2. Select the OracleHOME_NAMETNSListener service--the service name if you are using the default listener name LISTENER--or OracleHOME_NAMETNSListenerlsnr, where lsnr is the non-default listener name.

  3. Click Start to start the service.

  4. In the Services window, click Close.

Task 4: Start the Database

Use the tool of choice, such as SQL*Plus, to start the database:

  1. Start SQL*Plus without connecting to the database by entering:

    SQLPLUS /nolog
    
    
  2. Connect to Oracle as SYSDBA:

    SQL> connect username/password as sysdba
    
    
  3. When you enter a STARTUP command, specify the database name and full path of the parameter file:

    SQL> startup database_name pfile=file
    
    

    If you do not specify the PFILE option, Oracle uses the standard initialization file location of $ORACLE_BASE/admin/db_name/pfile/sid on UNIX platforms and ORACLE_BASE\admin\db_name\pfile\sid on Windows NT; if you do not specify a database name Oracle uses the value of the DB_NAME parameter specified in the initialization file.

    See Also:

    Oracle8i Administrator's Guide for further information about starting the database 

Task 5: Start Oracle Connection Manager

If Oracle Connection Manager is installed and configured, start it with the CMCTL control utility:

  1. From the command line, enter:

    CMCTL
    CMCTL> start cman
    
    
    

    CMCTL displays a status message indicating that Oracle Connection Manager has started successfully.

  2. Exit from the CMCTL utility. Enter:

    CMCTL> exit
    
    

On Windows NT, the listener may also be started through the Control Panel:

  1. Double-click the Services icon in the Control Panel window.

  2. If you are using Oracle Names, select the OracleHOME_NAMECMAdminService to acquire information about available Oracle Names Servers, then click Start. If you are not using Oracle Names, do not start this service.

    The service starts.

  3. Select the OracleHOME_NAMECManService to start the Oracle Connection Manager, and click Start.

    The service starts.

  4. In the Services window, click Close.

Entering a Connect String

After the network components are started, as described in "Connecting to a Database" you should be able to make a connection across the network. How you make a connection depends upon the naming method you configured in Chapter 6, "Configuring Naming Methods" and the tool used for the connection.

The connect strings takes the following basic form:

CONNECT username/password@connect_identifier

Connect Identifier Syntax Characteristics

A connect identifier cannot contain spaces unless enclosed within single quotes (' ') or double quotes (" "). In the following examples, connect identifiers that contain spaces are enclosed in single quotes.

CONNECT scott/tiger@'(description=(address=(protocol=tcp)(host=sales-server) 
(port=1521))(connect_data=(service_name=sales.us.acme.com)))'
CONNECT scott/tiger@'cn=sales, cn=OracleContext, dc=us, dc=acme, dc=com'

Single quotes (') are required if a double quote (") is used in the connect identifier. For example:

CONNECT scott/tiger@'sales@Good"Fast"Food.com' 

Likewise, double quotes (") are required if a single quote (') is used in the connect identifier. For example:

CONNECT scott/tiger@"cn=sales, cn=OracleContext, ou=Mary's Dept, o=acme"

Initiating Connections

There are a number of ways to initiate a connection to an Oracle server. Commonly used methods are described in the following sections:

The specifics of use are slightly different in each case. Each of the general methods listed is briefly covered here. To identify the method used in a specific tool, refer to the user guide for the tool.

Connecting from the Operating System to Test a Client

The general form of connecting an application to a database server from the command line is:

tool username/password@net_service_name

SQLPLUS system/password@sales

To prevent the password from displaying during a logon, you can leave out the password parameter on the command line. For example:

SQLPLUS system@sales

You will be prompted to enter your password without it showing on screen.

Most Oracle tools can use the operating system command line to connect; some provide alternatives.

Connecting from the Tool Logon Screen to Test a Client

Some tools provide a logon screen as an alternative form of logon. A user can log on to a database server by identifying both the user name and net service name (username@net_service_name) in the user name field of the tool logon screen, and typing the password as usual in the password field.

Connecting from 3GL to Test a Client

In applications written using 3GL, the program must establish a connection to a server using the following syntax:

exec sql connect :username identified by :password 

In this connection request, the :username and :password are 3GL variables that can be set within the program either statically or by prompting the user. When connecting to a database server, the value of the :username variable is in the form:

username@net_service_name 

The :password variable contains the password for the database account to which you are connecting.

Connecting Using Special Commands within Tools

Some Oracle tools have commands for database connection, once the tool has been started, to allow an alternative username to be specified without leaving the tool. SQL*Plus allows the CONNECT command using the following syntax:

SQL> CONNECT username/password@net_service_name 

For example:

SQL> CONNECT scott/tiger@serverx 

This is very similar to the operating system command line method, except that it is entered in response to the tool prompt instead of the operating system prompt.

Other Oracle tools use slightly different methods specific to their function or interface. For example, Oracle CDE tools use logon buttons and a pop-up window with the username, password, and remote database ID field.

Testing the Network

The preferred sequence for testing the network is as follows:

  1. Start and test each Oracle Names server (if included in your network layout).

  2. Start and test each listener.

  3. Start and test each Oracle Connection Manager (if included in your network layout).

  4. Test the server with a loopback test.

  5. Test client with a connection.

This section covers the following topics:

Testing an Oracle Names Server

To test an Oracle Names server, use the NAMESCTL PING command. Following are two ways to PING the Oracle Names server LABRADOR in the US.ACME domain.

From the NAMESCTL prompt, enter:

NAMESCTL> ping labrador.us.acme


You can test several Oracle Names servers with the same PING command. For example:

NAMESCTL> ping huey.uk.acme duey.uk.acme louie.uk.acme

PING responds with the time it takes to contact the Oracle Names server and return an acknowledgment. If PING fails, make sure the Oracle Names server is started or double-check the configured address of the Oracle Names server.

Testing Network Objects Using Net8 Assistant or NAMESCTL Utility

The information stored in an Oracle Names server can be queried to verify registration with the QUERY command.

To use the QUERY command, use either Net8 Assistant or the NAMESCTL control utility:

Use Net8 Assistant...  Use NAMESCTL Control Utility... 
  1. Start Net8 Assistant:

    -On UNIX, run netasst at $ORACLE_HOME/bin.

    -On Windows NT, choose Start > Programs > Oracle - HOME_NAME > Network Administration > Net8 Assistant.

  2. Double-click the Oracle Names server folder.

  3. Select an Oracle Names server.

  4. Choose Manage Data from the drop-down list box.

  5. Click the Advanced tab.

  6. Select Query.

  7. Enter the name of the object to query in the Name field.

  8. Optionally, enter the type of the object in the Name field:

    -A.SMD: Network addresses, such a database network definitions for net service names.

    -CNAME.SMD: Aliases

    -DL.RDBMS.OMD: Global database links

    -DLCR.RDBMS.OMD: Link qualifiers

    -NS.SMD: Oracle Names server address. System data used to communicate between Oracle Names servers

    -V1ADD.NPO.OMD: SQL*Net Version 1 connect string

  9. Select Execute.

  10. Select Save Network Configuration from the File menu.

  11. Select Exit from the File menu to exit the Net8 Assistant application.

 

For a Oracle Names server in the administrative region, create and register an alias with the Oracle Names server:

To display all data:

NAMESCTL
NAMESCTL> query name *

The type of information to retrieve may also be requested. Common object types include:

-A.SMD: Network addresses, such a database network definitions for net service names.

-CNAME.SMD: Aliases

-DL.RDBMS.OMD: Global database links

-DLCR.RDBMS.OMD: Link qualifiers

-NS.SMD: Oracle Names server address. System data used to communicate between Oracle Names servers

-V1ADD.NPO.OMD: SQL*Net Version 1 connect string

To display the database address for a net service name:

NAMESCTL
NAMESCTL> query name a.smd

The following example shows a query of the net service name sales:

NAMESCTL
NAMESCTL> query sales a.smd

The QUERY command returns the amount of time the transaction took and information about the network object.


 

Testing a Listener

To test a listener, initiate a connection from a client to any active database controlled by that listener, as described in "Testing Configuration on the Server".

Testing Oracle Connection Manager

To test Oracle Connection Manager, initiate a connection from a client to any active database for which a source route address has been created.

Testing Configuration on the Server

Once you have configured the network, test the configuration by performing a loopback test on the server.

A loopback test uses Net8 to go from the server back to itself, bypassing the Interprocess Communication (IPC). Performing a successful loopback verifies that Net8 is functioning on the server side.

To perform the loopback test, use Net8 Assistant:

  1. Start Net8 Assistant:

    • On UNIX, run netasst from $ORACLE_HOME/bin.

    • On Windows NT, choose Start > Programs > Oracle - HOME_NAME > Network Administration > Net8 Assistant.

  2. In the navigator, expand Directory or Local > Service Naming.

  3. Select the net service name or database service.

  4. Choose Command > Test Net Service.

    Testing assumes the database and listener are running. If they are not, see "Using Net8 Control Utilities" to start components.

    A successful test results in the following message in the Connect Test dialog box:


    If the test was not successful:

    • Ensure the database and listener are running, then click Test.

    • Click Change Login to change the user name and password for the connection, then click Test.

  5. Click Close to dismiss the Connect Test dialog box.

Testing Network Connectivity from the Client

To test several different clients in your network, initiate a connection to a server from each of them by following the instructions in "Entering a Connect String".

Net8 also provides the following tools to help you evaluate network connectivity:

TNSPING Utility

TNSPING 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 can connect successfully from a client to a server (or a server to another server) using TNSPING, it displays an estimate of the round trip time (in milliseconds) it takes to reach the Net8 service.

If it fails, it displays a message describing the error that occurred. This allows you to see the network error that is occurring without the overhead of a database connection.

Using TNSPING

To invoke the TNSPING utility, enter the following:

tnsping net_service_name [count]


Note:

Different platforms may have different interfaces, but the program accepts the same arguments. Invoke TNSPING for the display of the proper interface requirements. 


If the net service name specified is a database name, TNSPING attempts to contact the corresponding listener. It does not actually determine whether or not the database itself is running. Use Server Manager to attempt a connection to the database.

Following are some examples of TNSPING.

Reaching a Database

To connect to a database using a net service name of spotdb, the following is entered:

tnsping spotdb

This produces the following message:

TNS Ping Utility for SunOS: 
Copyright (c) Oracle Corporation 1998.  All rights reserved.
Attempting to contact 
(ADDRESS=(PROTOCOL=TCP)(HOST=spot)(PORT=1521)) 
OK (50msec)

To determine whether a connection can be made to the stprd database, and to specify that TNSPING try to connect 10 times and then give up, use the following command:

tnsping stprd 10

This command produces the following message:

TNS Ping Utility for SunOS: 
Copyright (c) Oracle Corporation 1998. All rights reserved. 
Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=spot)(PORT=1521))
OK (290 msec)
OK (100 msec)
OK (70 msec)
OK (70 msec)
OK (60 msec)
OK (70 msec)
OK (70 msec)
OK (80 msec)
OK (180 msec
OK (340 msec)
Invalid Net Service Name

Below is an example of TNSPING attempting to connect to an invalid net service name:

tnsping bad_db

This attempt produces the following message:

TNS Ping Utility for SunOS:
Copyright (c) Oracle Corporation 1998.  All rights reserved.
TNS-03505: Failed to resolve name
Valid Net Service Name Without Listener

Following is an example of using TNSPING to connect to a name that is valid, but that resolves to an address where no listener is located (for example, the listener may not be started):

tnsping testing

The following message is returned:

TNS Ping Utility for SunOS:
Copyright (c) Oracle Corporation 1998.  All rights reserved.
Attempting to contact (ADDRESS=(PROTOCOL=tcp)(HOST=spot)(PORT=1521))
TNS-12541: TNS:no listener 
Reaching an Oracle Names Server

To check whether a Oracle Names server can be reached, use a command using the Net8 address as in the following:

tnsping (address=(protocol=tcp)(host=fido)(port=1575))

A message similar to the following will be returned to the user:

TNS Ping Utility for SunOS: 
Copyright (c) Oracle Corporation 1998. All rights reserved. 
Attempting to contact (ADDRESS=(PROTOCOL=TCP)(HOST=fido)(PORT=1575))
OK (70 msec) 

TRCROUTE Utility

The Trace Route Utility (TRCROUTE) enables administrators to discover what path or route a connection is taking from a client to a server. If TRCROUTE encounters a problem, it returns an error stack to the client instead of a single error. These additional error messages make troubleshooting easier.

TRCROUTE is different from TNSPING in that it travels as a special type of connect packet, and is routed as such. As it travels toward its destination, the TRCROUTE connect packet collects the TNS addresses of every node it travels through. If an error occurs, TRCROUTE collects error information that shows where the error occurred. The Trace Route Utility displays the information collected on the client screen. You can redirect the TRCROUTE output to a file, and print it if you wish.

Requirements

Trace Route works only over Net8 and SQL*Net version 2.3 and later. Every node along the route from client to server must use SQL*Net version 2.3 or later. If a pre-2.3 node is on the path, the following error is displayed:

TNS-03603:  Encountered a node with pre-2.3 version of SQL*Net

TRCROUTE shows what node along the path is responsible for any errors.

Effect on Performance

The Trace Route Utility uses minimal resources. It gathers information in the connect data of a special connect packet; standard connect packets are not affected.

The server is not affected by TRCROUTE. The listener receives and processes the TRCROUTE connect packet. It returns the information to the client by putting it into a refuse packet. The server does not need to start up any new processes or deal with dummy connections.

Using TCROUTE

To invoke TRCROUTE, enter the following from the command line:

trcroute net_service_name

The following are two examples of trace route output.

Example 11-1 shows a successful Trace Route packet that traveled from a client to a listener.

Example 11-1 Successful Trace Route

%trcroute tcp_direct
Trace Route Utility for Solaris:
Copyright (c) Oracle Corporation 1998.  All rights reserved.

Route of TRCROUTE:------------------
Node: Client            Time and address of entry into node:
-------------------------------------------------------------
01-DEC-98 13:26:36 ADDRESS= PROTOCOL=TCP  Host=shining-sun  Port=1581
Node: Server            Time and address of entry into node:
-------------------------------------------------------------
01-DEC-98 13:27:20 ADDRESS= PROTOCOL=TCP  Host=setting-sun  Port=1521

Example 11-2 shows an unsuccessful Trace Route packet that could not reach the listener because the listener was not up.

Example 11-2 Trace Route with Error

% trcroute tcp_direct
Trace Route Utility for SVR4:
Copyright (c) Oracle Corporation 1998.  All rights reserved.

Route of TRCROUTE:------------------
Node: Client            Time and address of entry into node:
-------------------------------------------------------------
01-DEC-98 11:12:34 ADDRESS= PROTOCOL=TCP  Host=shining-sun  Port=1581
TNS-12224: TNS:no listener
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-03601: Failed in route information collection

Net8 Assistant

To verify connectivity for a client machine, use Net8 Assistant:

  1. Start Net8 Assistant:

    • On UNIX, run netasst from $ORACLE_HOME/bin.

    • On Windows NT, choose Start > Programs > Oracle - HOME_NAME > Network Administration > Net8 Assistant.

  2. In the navigator, expand Directory or Local > Service Naming.

  3. Select the net service name or database service.

  4. Choose Command > Test Net Service.

    Testing assumes that the database and listener are running. If they are not, see "Using Net8 Control Utilities" to start components.

    A successful test results in the following message in the Connect Test dialog box:


    If the test was not successful:

    • Ensure the database and listener are running, then click Test.

    • Click Change Login to change the user name and password for the connection, then click Test.

  5. Click Close to dismiss the Connect Test dialog box.


Go to previous page Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index