SQL*Net Configuration [Orig Published – Apr 1999]

Let’s set up SQL*Net (known stuff for most DBAs, but I get many questions on this subject often, so here I just provide some examples/templates for the configuration files) on the UNIX server and client PC using the TCP/IP communication protocol. In Oracle8 SQL*Net is called Net8. SQL*Net enables client-server and server-server communication across any network. When a client or server makes a connection request, SQL*Net receives the request and, if more than one machine is involved, passes the request to its underlying layer, the transparent network substrate (TNS), to be transmitted over the appropriate communications protocol to the appropriate server. On the server, SQL*Net receives the request from TNS and passes it to the database as a network message with one or more parameters (that is, a SQL statement). For more information on SQL*Net technology, please refer to “Understanding SQL*Net” manual from Oracle corp.

SQL*Net software

SQL*Net and required protocol adapters come with the Oracle RDBMS CD and the Oracle client CD. Install SQL*Net software and TCP/IP protocol adapters along with server installation. SQL*Net on the server would be installed to $ORACLE_HOME/network. The executables are under $ORACLE_HOME/bin. Oracle7 client software would be installed under $ORACLE_HOME/network and Oracle8 Net8 client software would be installed under $ORACLE_HOME/net80. It is possible to access a Oracle7 database using Net8, also to access a Oracle8 database using SQL*Net (Oracle8 specific features may not be available).


SQL*Net is mainly configured using 3 ascii files, which contain information about the database, the protocol, the host name and connection port. The default location for the configuration files is $ORACLE_HOME/network/admin. You may specify a different location by specifying the enviornment variable TNS_ADMIN on the server side. For client side, set this variable in the client side Windows Registry (for 32 bit) or in the oracle.ini file (for 16 bit). The following are the files associated.


The listener configuration file. This file is set up in the server. Specify the type of protocol (we discuss TCP/IP), the host name, the database instance name (SID) and oracle home directory for this instance. You can have multiple databases configured under the same listener name. The standard and default and recommended listener name is LISTENER and most of the machines need only one listener. You can have a Oracle7 listener and Oracle8 listener running with the same name but listening to different ports. Here is a sample listener.ora file:

Please note that since the listener name is LISTENER, the parameters also end with LISTENER, if your listener name is DALLAS, the parameters would be SID_LIST_DALLAS, CONNECT_TIMEOUT_DALLAS, etc.
There are two instances defined in this listener file. Note that the second entry does not have any PRESPAWN entries (optional). For a description of these parameters and other control parameters, please refer to the manual “Understanding SQL*Net”.


This file is used to identify the destinations (databases). The file has information for the connect string the user specify, such as, the port number, host name, SID name, etc. This file should be available locally from where the connection is made (at the client PC as well as server). You can have different alias names (connect strings) for the same database defined. For each alias name, define an entry in this file. Here is an example:

Make sure you have the HOST, PORT and SID defined correctly. You can also provide the IP address of the HOST instead of name. Notice the entry for DALDEV, there are two port addresses, this is to randomize connections between listners, if there are two listeners on the server (listener load balancing). All the lines are self explanatory, for more information, refer to “Understanding SQL*Net”.


This is a configuration file, which may be present in the server as well as the client. Basically this file is used to cofigure the following:

Dead connections detection
Tracing and logging parameters
Default domain (notice that in the tnsnames.ora file we have .world in the connect string names, you can specify default domain as world in this file, so the users need not specity it while connecting)
Other optional parameters

A sample file would be like this:

Some parameters are specific to the server and some are specific to the client.

Managing the listener(UNIX):

Make sure you have ORACLE_HOME set, also if the config files are not in ORACLE_HOME/network/admin, set TNS_ADMIN to the directory.
To start the listener use the utility lsnrctl

lsnrctl start

If you have a listener name other than LISTENER then specify that name as

lsnrctl LISTENERNAME start

To stop the listener,

lsnrctl stop

If you have made changes to the listener, but do not want to stop and start, you may do

lsnrctl reload

To see the listener status,

lsnrctl status

You can also specify password for the listener.


If you have many clients, it may be a maintenance problem to have tnsnames.ora and sqlnet.ora on each client PC. You can install SQL*Net on the network and everyone can share the same information. For 32 bit SQL*Net, make sure the client PC windows registry points to the network and for 16 bit SQL*Net set up the oracle.ini file with appropriate parameters. The oracle.ini file is mentioned in the win.ini file underORA_CONFIG=Drive:\path\oracle.ini. The parameters you have to look for are ORACLE_HOME, NLS_LANG, TNS_ADMIN, RDBMS73, ORA_NLS32 etc.

Leave a Reply

%d bloggers like this: