Understanding SQL*Net

Contents Glossary Index Home Previous Next

Testing the Network Configuration

Note: This section assumes that you are not using Oracle Names 2.0 with the Dynamic Discovery Option enabled. If you are using the Dynamic Discovery Option, please refer to the Oracle Names Administrator's Guide for information about starting the network.

Configure the network using the Oracle Network Manager. Once the configuration files are on the destination machines, each component can be started and tested. The preferred sequence for testing the network is to:

Start a Names Server

The STARTUP command of the NAMESCTL utility loads the Names Server into memory and tells it to begin executing. At startup, the Names Server loads its configuration, loads its data, then becomes available to answer requests.

NAMESCTL> STARTUP

Test a Names Server

To test that a Names Server is operating correctly, use the PING command. Following are two ways to PING the server LABRADOR in the US.ACME domain. Alternatively, you can use TNSPING.

NAMESCTL> PING LABRADOR.US.ACME
or
NAMESCTL> SET SERVER LABRADOR.US.ACME
NAMESCTL> PING

You can also PING multiple Names Servers by using a single command, for example:

NAMESCTL>PING HUEY.UK.ACME DUEY.UK.ACME LOUIE.UK.ACME

PING responds with the time it takes to contact the Names Server and return an acknowledgment.

If PING fails, make sure the Names Server has been started. If it has been, double-check the configuration in Network Manager, especially the defined address of the Names Server in question.

Start the Listener

From each listener's node, use the Listener Control Utility, LSNRCTL, to start each listener. In command line mode, to start a default listener (which is a listener defined in a LISTENER.ORA file with the alias LISTENER):

LSNRCTL START 

To start a non-default listener:

LSNRCTL START listener_name 

LSNRCTL will display a status message indicating that it has started successfully. After LSNRCTL has started the listener, it has no further control over the listener. Check that all expected SIDs for that listener are listed in the services summary in the status message. For more information on the Listener Control Utility see the section "Using the Listener Control Utility" later in this chapter.

Test the Listener

To test the listener, initiate a connection from a client in the same community as the listener to any active database controlled by that listener.

The simplest test uses SQL*Plus as follows:

SQLPLUS user/password@service_name 

The service_name may be found in the TNSNAMES.ORA file, an Oracle Names Server, or a native naming service such as NIS or DCE's CDS. For more information on testing SQL*Net from a client, see the section "Initiating a SQL*Net Connection" later in this chapter.

If there are no clients in the same community as the listener, you must start an Interchange before testing the listener.

Repeat these steps for each listener in the network.

Start theInterchange

Use the Interchange Control Utility, INTCTL, on the Interchange node to start an Interchange. (You cannot run INTCTL from a remote node.) For example, in command linemode the command is:

INTCTL START INTERCHANGE 

or

INTCTL START INT 

INTCTL displays a status message indicating that it has started successfully. For more information on the Interchange Control Utility see Chapter 6, "Controlling the MultiProtocol Interchange," in the Oracle MultiProtocol Interchange Administrator's Guide.

Test the Interchange

To test the Interchange, initiate a connection through the Interchange from a client in one community to a database in another. On the client machine type:

SQLPLUS user/password@service_name 

The service_name for the database in the other community may be stored in TNSNAMES.ORA, an Oracle Names Server, or a native naming service such as NIS or DCE's CDS. To ensure that the connection went through the Interchange, type:

INTCTL STATUS INTERCHANGE 

The Connection Manager should indicate that there is one active connection through the Interchange. You can run the STATUS command on the Interchange machine. If the Interchange is listed in the TNSNAMES.ORA file, stored in an Oracle Names Server, or stored in a native naming service, then you can run the STATUS command remotely from any other node.

Test Network Objects Using NAMESCTL

To test that a network object exists, use the QUERY comand. The syntax for this command is as follows:

NAMESCTL> QUERY global_object_name type

Database service names have the type A.SMD, and database links have the type DL.RDBMS.OMD. The following example shows a query of the database service name BUGSY in the MACS.ACME domain.

NAMESCTL> QUERY BUGSY.MACS.ACME A.SMD

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

Test Network Objects Using TNSPING

The network administrator can use TNSPING to determine whether or not a service on a SQL*Net network can be successfully reached. The service being contacted can be an Oracle database, an Oracle Names Server, or any other Oracle (TNS) service.

If you can connect successfully to a TNS service using TNSPING, it displays an estimate of the round trip time (in milliseconds) it takes to reach the Oracle 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.

You invoke TNSPING on the command line as follows:

	tnsping service_name count

On some platforms, such as Microsoft Windows, the interface may be different, but the program accepts the same arguments.

If the service name specified is a database name, TNSPING attempts to contact the corresponding network listener. It does not actually determine whether or not the database itself is running. (To do this, use Server Manager to attempt a connection to the database.)

Examples of the Use of TNSPING

Following are some examples of how a network administrator or user can use TNSPING. For example, to connect to a database named SPOTDB, the command:

	tnsping spotdb

produces the following message:

TNS Ping Utility for SunOS:  Version 2.2.2.0.0 - Production on 10-Mar-95 10:09:13
Copyright (c) Oracle Corporation 1995.  All rights reserved.
Attempting to contact (ADDRESS=(COMMUNITY=build_tcp.us.oracle.com)(PROTOCOL=TCP)
(HOST=spot)(PORT=1599)) 
OK (50msec)

To check whether an Oracle Names Server can be reached, use a command similar to the following:

	tnsping (ADDRESS=(COMMUNITY=build_tcp.us.oracle.com)     (PROTOCOL=TCP)(HOST=fido)(PORT=1600))

The address of the Oracle Names Server is located in SQLNET.ORA (in the NAMES.PREFERRED_SERVERS and NAME.PREFERRED_SERVERS parameters) on the client.

Note: Both parameters showing the client's preferred Names Server must be included for backward compatibility with an earlier version of the product.

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

TNS Ping Utility for SunOS: Version 2.2.2.0.0 - Production on 10-Mar-95 10:09:59
Copyright (c) Oracle Corporation 1995. All rights reserved. 
Attempting to contact (ADDRESS=(COMMUNITY=build_tcp.us.oracle.com) (PROTOCOL=TCP)(HOST=fido)(PORT=1600))
OK (70 msec) 

To determine whether the STPRD database can be connected to, 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:  Version 2.2.2.0.0 - Production on 10-Mar-95 10:10:28 
Copyright (c) Oracle Corporation 1995. All rights reserved. 
Attempting to contact (ADDRESS=(COMMUNITY=build_tcp.us.oracle.com) (PROTOCOL=TCP)(HOST=spot)(PORT=1599))
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)  

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

tnsping invalid_service_name

This attempt produces the following message:

TNS Ping Utility for SunOS:  Version 2.2.2.0.0 - Production on 10-Mar-95 10:10:58
Copyright (c) Oracle Corporation 1995.  All rights reserved.  
TNS-03505: Failed to resolve name 

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

tnsping testing

The following message is returned:

TNS Ping Utility for SunOS: Version 2.2.2.0.0 - Production on 10-Mar-95 10:11:42 
Copyright (c) Oracle Corporation 1995.  All rights reserved.  
Attempting to contact (ADDRESS=(PROTOCOL=tcp)(HOST=spot)(PORT=1599))
  TNS-12541: TNS:no listener 

Test All Client Types

Make sure that each client type is tested. It is not enough to test that the Interchange works. If there are several different client types in your network, initiate a connection to a server from each of them. If a connection is unsuccessful, use logging and tracing--the diagnostic tools--to find the cause of the problem. An error stack in the error log may point to the problem. If not, turn on tracing and repeat the operation. You can find information about error logging and tracing in Chapters 1 through 3 of the .


Contents Glossary Index Home Previous Next