The Listener Networking TipsCopyright © Howard Rogers 2002 3/4/2002 Page
1 of 2
What is a Listener?
The Listener is a named process which runs on the Oracle Server, awaiting requests fromClients to connect to the Instance. By default, the Listener name is (amazingly enough)“Listener” (but you can call it anything you like). It listens for connection requests on aparticular port (the default port number in 8.0 and above is 1521, but once again you canset this to any valid port number if you wish). A client knows where to contact theListener (the machine it’s running on, and the port it’s listening on) because a localconfiguration file, called “tnsnames.ora”, gives it the necessary information. Moreadvanced configurations can dispense with the tnsnames.ora (for example, you can opt toinstall a “Names Server”, which does the same job of telling the client where to find theListener).Upon receiving a connection request from a client, the Listener can do one of two things.Either it will spawn a new Server Process, and redirect the client to talk directly to thatServer Process… at which point, the Listener drops out of the picture altogether, andcontinues to listen for connection requests from other clients. This is known as‘bequeathing’ the Server Process to the client, in the sense of ‘making a gift’ –and theclient is then said to have a Bequeath Session.Or it will inform the client of the network address of a Server Process which has alreadybeen created when the Instance was started (a “pre-spawned Server Process), and theclient is then able to make direct contact with that Server Process. Note again, however,that once the connection is established between the client and the Server Process, theListener simply continues to listen for new connection requests. This is known as‘redirecting’ the client to the Server Process, and hence the client is said to have aRedirect Session.The only real difference between Bequeath and Redirect sessions is that, in theory, ittakes longer to set up a Bequeath session (the Server Process has to be created fromscratch, for a start). However, the drawback with Redirect Sessions is that you have topre-spawn a bunch of Server Process and hope that enough clients want to connect tomake them useful… overdo it, and you just have a lot of processes chewing up memory andCPU cycles for no particular reason.Whatever type of session you end up with, though, it’s important to realise that theListener is merely instrumental in
the connection; once established, theListener plays no further part in client-server communications. It is therefore possible tokill a Listener, and no existing User would be any the wiser.The above description applies only to Dedicated Server configurations, where each User isconnected directly to one Server Process that does nothing but service that User’s requests.It is also possible, however, to configure Oracle in what is known as Multi-Threaded ServerConfiguration (now known in 9i, more accurately, as “Shared Server Configuration”). The