Net8 Administrator's Guide Release 8.1.5 A67440-01 |
|
Once you have completed configuring your network, you make a connection and test each component to ensure the network is functioning properly. Net8 provides a variety of tools to help you start, test and control a Oracle Names server, listener, and Connection Manager.
This chapter outlines procedures to make a connection and test network components using Net8's control utilities. This chapter contains the following sections:
Connecting to a database involves starting network components and entering a connect string with a net service name, such as connect username/password@net_service_name.
This section covers the following topics:
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.
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:
On Windows NT, an Oracle Names server may also be started through the Control Panel:
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 located in $ORACLE_HOME/network/names
on UNIX and ORACLE_HOME
\network\names
on Windows platforms.
To create a client cache:
namesctl
namesctl> start_client_cache
On Windows NT, the client cache may also be started through the Control Panel:
For Net8 to accept connections on the server, a listener must be started with the LSNRCTL control utility on the server:
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 the listener is running, go to Step 2. If the listener is not running, go to Step 3.
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
.
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.
lsnrctl> exit
On Windows NT, the listener may also be started through the Control Panel:
Use the tool of choice to start the database, such as SQL*Plus:
sqlplus /nolog
sql> connect username/password as sysdba
sql> startup database_name
pfile=initsid.ora
If you do not specify the PFILE option Oracle uses the standard parameter 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 for DB_NAME in the parameter file that starts the instance.
For further information on starting the database, see Oracle8i Administrator's Guide.
If Oracle Connection Manager is installed and configured, start it with the CMCTL control utility:
cmctl
cmctl> start cman
CMCTL displays a status message indicating that Oracle Connection Manager has started successfully.
cmctl> exit
On Windows NT, the listener may also be started through the Control Panel:
The service starts.
The service starts.
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 Listener" and the tool used for the connection. The basic connect strings to use are shown below:
There are a number of ways to initiate a connection to an Oracle server. Commonly used methods include:
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 tool's user guide.
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.
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.
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 being connected to.
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 allow 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. For more information on connecting to Oracle with a specific tool, refer to the tool's user guide.
The following checklist is provided to help you troubleshoot common problems you may encounter when starting Net8 components or making a connection.
Problem | Work-Around |
---|---|
Inactive Components |
|
Syntax errors in your configuration files |
|
Files are incorrectly placed. |
|
The address is already in use. |
Another process may already be using the address listed in the listener configuration file (LISTENER.ORA). On some protocols such as TCP/IP, DECnet, and OSI, each network service on a node must use a unique port or socket. On other network protocols such as SPX or NetBIOS, each net service name must be unique for the entire network. Another network service may be using the same configuration. Contact your network administrator to evaluate whether the network address is available. |
When trying to connect to a database, you may get the message |
Use the Listener Control Utility (LSNRCTL) to start the listener. |
When trying to make a connection from a client, you may get the message |
|
When trying to connect to a database, you may get the message |
The database is not running on the server machine. A listener alone does not provide a database connection; the database instance must also be started. |
A client returns the message |
Connect requests that come in too quickly for a listener to handle, and which exceed the listener's backlog (determined by QUEUESIZE parameter in LISTENER.ORA), are returned with an " To correct this problem, follow these steps: |
When attempting to stop the listener, you may get the message TNS-01169: "The listener has not recognized the password." |
Enter the SET PASSWORD command from within the Listener Control Utility (LSNRCTL), and then enter the STOP command to stop the listener. |
The preferred sequence for testing the network is as follows:
This section cover the following topics:
Net8 provides the following tools to help you start, test and control each network component.
For more information about Net8's component control utilities and their commands, refer to Appendix A, "Control Utilities for the Listener, Oracle Names Server, and Oracle Connection Manager".
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
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
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
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, type:
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.
The information stored in an Oracle Names server ("Configuring the Network with the Oracle Names Method") can be queried to verify registration with the QUERY command.
To use QUERY command, use either the Net8 Assistant or the NAMESCTL control utility:
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". If the only clients available to access the listener are on a different protocol, you must use an Oracle Connection Manager to access the listener.
To test Oracle Connection Manager, initiate a connection from a client to any active database for which a source route address has been created.
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 the Net8 Assistant:
Testing assumes the database and listener are running. If they are not, see "Net8 Component Startup Overview" to start components.
A successful test results in "The connect test was successful." message in the Connect Test dialog box:
If the test was not successful:
To test several different clients in your network, initiate a connection to a server from each them by following the instructions in "Entering a Connect String".
Net8 also provides the following tools to help you evaluate network connectivity:
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.
To invoke the TNSPING utility, enter the following:
tnsping net_service_name [count]
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.
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 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: 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)
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
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
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)
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.
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.
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.
To invoke TRCROUTE, type the following from the command line:
trcroute net_service_name
If you have configured your network to use listener load balancing, there may be more than one listener on different nodes for a database. If so, the Trace Route Utility might use any of the listeners, just as a regular connection request might. The output it returns shows you what listener node it used.
The following are two examples of trace route output:
%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-96 13:26:36 ADDRESS= PROTOCOL=TCP Host=shining-sun Port=1581 Node: Server Time and address of entry into node: ------------------------------------------------------------- 01-DEC-96 13:27:20 ADDRESS= PROTOCOL=TCP Host=setting-sun Port=1521
% trcroute tcp_direct Trace Route Utility for SVR4: Copyright (c) Oracle Corporation 1996. All rights reserved. Route of TRCROUTE:------------------ Node: Client Time and address of entry into node: ------------------------------------------------------------- 01-DEC-96 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
To verify connectivity for a client machine, use the Net8 Assistant:
Testing assumes the database and listener are running. If they are not, see "Net8 Component Startup Overview" to start components.
A successful test results in "The connect test was successful." message in the Connect Test dialog box:
If the test was not successful: