Network Topology   «Prev  Next»
Lesson 7Testing your Oracle Net Services Connectivity
ObjectiveDescribe the Oracle Tools used to test Connectivity

Testing Oracle Net Services Connectivity

Using TNSPING Utility to Test Connectivity from the Client

The TNSPING utility determines whether the listener for a service on an Oracle Net network can be reached successfully. If you can connect successfully from a client to a server (or a server to another server) using the TNSPING utility, then it displays an estimate of the round trip time (in milliseconds) it takes to reach the Oracle Net service. If it fails, then it displays a message describing the error that occurred. This enables you to see the network error that is occurring without the overhead of a database connection.
Use the following command to test connectivity:
tnsping net_service_name count
In the preceding command, the following arguments are used:
  1. net_service_name must exist in tnsnames.ora file or the name service in use, such as NIS.
  2. count determines how many times the program attempts to reach the server. This argument is optional.

If the network service name specified is a database name, then TNSPING attempts to contact the corresponding listener. It does not actually determine whether the database is running. Use SQL*Plus to attempt a connection to the database.
The following are some examples of TNSPING:
Invoke TNSPING for the display of the proper interface requirements.
Example 6-7 is an example of checking a listener for a database using a network service name of sales using the TNSPING
Example 6-7: Checking a Listener with TNSPING
TNSPING sales
This produces the following message:
TNS Ping Utility for Linux: Version 12.1.0.1.0 - Production on 21-NOV-2012
Copyright (c) 1997, 2012 Oracle Corporation. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL =
TCP)(HOST = sales-server)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =
sales.us.example.com)))
OK (10 msec)
What do you do if the tnsnames.ora entry was made manually?
When you add a new TNS entry to your tnsnames.ora file, it is always a good idea to test the connectivity. Actually, you need to perform two tests:
  1. Test connectivity to the server.
  2. Test connectivity to the Oracle listener.
Click the link below to practice performing these two tests.
Testing Database Connection

Legacy Note

Oracle Corporation introduced interdatabase connectivity with SQL*Net in Oracle Version 5 and simplified its usage considerably with the database links feature in Oracle Version 6, opening up a world of distributed possibilities. Oracle now supplies a variety of techniques that you can use to establish interdatabase connectivity and data sharing. Each technique has its advantages and disadvantages, but in many cases the best solution is not immediately obvious. The next lesson concludes this module.