When an database instance starts, it registers itself with a listener using one or more service names. When a client program or database connects to a listener, it requests a connection to a service.
A service name can identify multiple database instances, and an instance can belong to multiple services.
For this reason, the listener acts as a mediator between the client and instances and routes the connection request to the appropriate instance. Clients connecting to a service need not specify which instance they require.
To connect to a database service, clients first contact a listener process that typically resides on the database server. The listener receives incoming client connection requests and sends these requests to the database server. After the connection is established, the client and database server communicate directly.
The listener knows which services can handle connection requests because an Oracle database dynamically registers this information with the listener. This process of registration is called service registration. Registration also provides the listener with information about the database instances and the service handlers available for each instance.
When the listener receives the client request, it selects one of the registered service handlers. Depending on the type of handler selected, the communication protocol used, and the operating system of the database server, the listener performs one of the following actions:
After the listener has completed the connection operation for the client, the client communicates directly with the Oracle database without the listener's involvement. The listener resumes listening for incoming network sessions.
The process in the 3 steps:
A listener is configured with one or more listening protocol addresses, information about supported services, and parameters that control its run-time behavior. The listener configuration is stored in a configuration file named listener.ora.
To know more about the listener configuration, see this article: Oracle Database - Configuration of the Listener (listener.ora)
cd $ORACLE_HOME/bin
./lsnrclt stop
./lsnrclt start
lsnrctl status
lsnrctl service
To set tracing parameters with Oracle Enterprise Manager and Oracle Net Manager:
This action add this line in the sqlnet.ora by example for the level admin : TRACE_LEVEL_SERVER = ADMIN
sqlnet.trc (for the client)
svr_pid.trc (for the server)
The default directory is ORACLE_HOME\network\trace.
listener.trc