Managing Users  «Prev  Next»

Lesson 6 Bouncing the listener
ObjectiveStop and restart Oracle listener and read new listener.ora file.

Stop and restart Oracle listener

Whenever you make a change to your listener.ora file, you need to 1) stop and 2) restart the listener in order for that change to take effect. This is because the Oracle Net listener only reads listener.ora at startup. This process of stopping and immediately restarting the listener is commonly referred to as bouncing the listener.
The process for bouncing the listener is simple:
  1. Start listener control
  2. Issue a stop command
  3. Issue a start command
Try the following simulation for this process:

Read new "listener.ora" file in order to make sure the changes take effect

The listener.ora file in Oracle 12c needs to be reloaded for changes to take effect. Here's the process:
  1. Make changes to the listener.ora file: Use a text editor to modify the necessary parameters in the listener.ora file, which is typically located in the `$ORACLE_HOME/network/admin` directory.
  2. Reload the listener configuration:
    • Open a command prompt or terminal window.
    • Navigate to the `$ORACLE_HOME/bin` directory.
    • Execute the following command:
      	lsnrctl reload
      	
    • This command instructs the listener to re-read the listener.ora file, incorporating the new configuration without completely stopping and restarting the listener process.

Here's a visual representation of the process:
Important notes:
  • Dynamic service registration: While database services register themselves dynamically with the listener, certain changes to listener parameters (e.g., listening addresses, port numbers) still require a reload to take effect.
  • Persistent changes: The reload only affects the currently running listener process. To make the changes persistent across listener restarts, you'll need to modify the actual listener.ora file.
  • Verifying changes: After reloading, use `lsnrctl status` or `lsnrctl services` to verify that the changes have been applied successfully.

Alternative to reloading: If you prefer to completely restart the listener, you can use the `lsnrctl stop` followed by `lsnrctl start` commands. However, reloading is generally a faster and less disruptive approach.
The `lsnrctl` command does not directly start the Listener Control Program. Here's a breakdown of how it works:
  • The Listener Process: The Oracle Net Listener is a separate process (or service) that usually runs in the background, listening for incoming connection requests. It's often configured to start automatically when your database instance starts.
  • lsnrctl: A Management Tool: The `lsnrctl` (Listener Control) command is a utility used to interact with an already running listener process. With it, you can:
    • Start a listener (`lsnrctl start`)
    • Stop a listener (`lsnrctl stop`)
    • Get its status (`lsnrctl status`)
    • Change configuration settings (`lsnrctl reload`)

Essentially, think of the listener as the engine that's already running, and lsnrctl as the set of controls you use to manage that engine.

Bouncing Oracle listener

  1. We will start this simulation at the Windows command prompt. Type the lsnrctl command, and press ENTER to start the Listener Control Program.
  2. Issue the stop command to shutdown the listener.
  3. The listener will stop. You will see a message telling you that your stop command completed successfully. Now, type start and press ENTER in order to restart the listener.
  4. You get quite a bit of feedback when starting the listener. Under the section titled Services Summary, you will see a list of instances for which the listener is listening. The COIN instance will be one of them. Use the exit command now, to return to the command prompt.
  5. This is the end of the simulation.


Starting and Shutting Down the Listener

The Oracle listener is set up to start automatically whenever your server machine is restarted. However, when your system encounters unforeseen circumstances, or when you have manually stopped the listener, you can restart it at the command line. To do so, use the following:
lsnrctl start
You can use Enterprise Manager to stop the listener. To do so, navigate to the Listener: listener_name page by clicking Listener on the Home page. To shut down the listener, click Stop. You can also stop it at the command line using the following:
lsnrctl stop

This simulation used the listener control program from a DOS prompt. On an Windows machine, you also have the option of stopping and starting the listener from the Services control panel[1]. This demonstratoin used lsnrctl because it is a universal approach that works on any Oracle installation, including those on Unix.
In the output from restarting the listener, the key item to look for is the service handler[2] for the COIN instance. This tells you that the listener is now monitoring the network for incoming connection requests for that instance. You will find an example of this in the exercise below, under the section titled Services Summary.

Bouncing Listener - Exercise

Click the Exercise link below, and do the exercise to stop and restart your listener in order for your addition of the COIN instance to take effect.
Bouncing Listener - Exercise

Net Listener Bounce - Quiz

After you have completed the exercise, click the Quiz link below to test your knowledge of the material you have learned so far.
Net Listener Bounce - Quiz
[1]Windows Services control panel: The Windows Services control panel is a built-in administrative tool that allows you to view and manage the various services running on your Windows system. Services are background processes that perform essential tasks, such as networking, printing, security updates, and more.
[2]service handler: A Oracle Net related entity that runs in conjunction with the listener to handle connection requests for a database instance.

SEMrush Software