Oracle Net allows us to spread the load associated with database applications. It is responsible for the communication between the client and the server. With Oracle Net, you can also configure server-to-server, where each server supports the client application and also has the ability to connect to other network servers.

Connection descriptors

The server and instance names are identified by the connection descriptor. It specifies the way to communicate, the server name and the service name of the instance used during query processing.

The general descriptor format looks like this:

(DESCRIPTION =

(ADDRESS =

(PROTOCOL = TCP)

(HQ = HOST

(PORT = 1521))

(CONNECT DATA =

SERVICE_NAME = XE)))

In this descriptor, we used TCP / IP, a server named HQ, and port 1521 (the Oracle number used for Oracle Net) that should handle the connection, and we also defined the connection to the XE instance of the HQ server.

Name of network services

In order for users not to have to enter a connection descriptor each time, we can define service names (or aliases) that refer to descriptors. Service names are in the TNSNAMES.ORA file  . This file should be located on every database server that is on the network (each client and server should have a copy of that file).

 

A user who wants to connect to a  localhost XE instance can use the XE service name.

SQLPLUS HR / HR @ XE

Listening processes

Each database server must have LISTENER.ORA on the network. This file contains the names and addresses of the listening processes, as well as the instances that are supported by these processes. Listening processes support connection requests from Oracle Net clients.

The sample section of LISTENER.ORA file  :

where:

LISTENER – is the name of the listening process

DESCRIPTION – acts as a container for the protocol address of the listening process

ADDRESS – specifies the single address of the listening process protocol

PROTOCOL – The protocol name used to connect to an instance

HOST – server name

PORT – port for connecting to an instance

In addition, we see a clause

DEFAULT_SERVICE_LISTENER = (XE)

This tells us which instance we connect by default, connecting to the server on which the above LISTENER.ORA file is defined.