| Lesson 4 |
Using the Listener Control Program |
| Objective |
View status of the listener using the Listener Control program |
Using the Oracle Listener Control Program in Oracle AI Database 26ai
Just as SQL*Plus is the command-line tool for starting, stopping, and managing an Oracle database, Oracle provides a dedicated command-line utility called
Listener Control[1] for starting, stopping, and managing the Oracle Net Listener specifically. The executable name is
lsnrctl — a single, stable name that's been current since Oracle8i and remains exactly what you'll use in Oracle AI Database 26ai today.
Three Useful Commands
We're going to cover three Listener Control commands to start:
HELP
STATUS
EXIT
HELP and EXIT are the easy ones. HELP gets you information about the commands available to you, and EXIT quits the Listener Control program and returns you to your command prompt. You'll use STATUS to report the current status of the listener — the command you'll reach for most often day to day. Try the following simulation to practice all three.
Using the Listener Control Program
- Start this simulation from your terminal or command prompt. Type
lsnrctl and press ENTER.
- The Listener Control program has started, and you now have an
LSNRCTL> prompt. Type help and press ENTER to see a list of valid commands.
- As you can see, the help command gets you a brief list of valid Listener Control commands. You can get further help on a specific command by typing
help followed by the command name. Try typing help status and see what happens.
- As you can see, the status command optionally accepts a listener name. You don't need to worry about that yet — just type
status to get a display showing the current status of the listener.
- The status display shows you several things: the time the listener was started, how long it's been up and running, the current trace level, and the location of the listener's parameter and log files. At the bottom, you'll see a list of services this listener is listening for — these usually represent databases. When you're done reviewing the status, type
exit to leave the Listener Control program.
- You're back at your command prompt. That's the end of the simulation.
Beyond the Basics: The Full Command Set
HELP, STATUS, and EXIT will get you through this lesson, but LSNRCTL supports a good deal more, organized into three broad categories worth knowing about even before you need them:
- Operational commands —
START and STOP, which do exactly what they say.
- Modifier commands — built around
SET, used to alter listener parameter values. SET CURRENT_LISTENER targets a specific listener when you're managing more than one; other SET sub-forms control logging, tracing, and configuration-persistence behavior.
- Informational commands —
STATUS and the various SHOW forms, which display current configuration and state without changing anything.
A few individual commands worth knowing by name:
- QUIT — a synonym for EXIT; both leave LSNRCTL identically.
- RELOAD — reloads
listener.ora so you can add or change statically configured services without stopping the listener. Genuinely useful once you're managing a listener that other people depend on and can't casually restart.
- SAVE_CONFIG — writes any changes made with SET back to
listener.ora so they persist. Without it, SET changes only last until the listener is stopped — a detail worth remembering the first time a configuration change you made "disappears" after a restart.
- SERVICES — returns detail about the database services, instances, and service handlers your listener is actually forwarding connections to, going one level deeper than a plain STATUS.
You don't need to memorize all of this right now — HELP will always remind you what's available — but it's worth knowing LSNRCTL is a more complete administration tool than three commands might suggest.
Who Can Administer the Listener
This matters for a course on managing users specifically: listener administration isn't open to just anyone, and how it's secured depends on whether you're connecting locally or remotely.
Local administration — running lsnrctl directly on the machine where the listener runs — relies on local operating system authentication. Only the user account that started the listener, or a superuser, can administer it this way.
Remote administration — managing a listener from a different machine — is disabled by default, and that's a deliberate security choice, not an oversight. Oracle's own recommendation is to perform listener administration locally, in the default mode, and if you genuinely need remote access, to reach it through Oracle Enterprise Manager Cloud Control or a secure shell (SSH) session rather than enabling direct remote LSNRCTL administration. Leaving remote administration open would mean anyone who could reach the listener's port over the network might attempt to control it — exactly the kind of unnecessary exposure a well-managed environment avoids.
Using Listener Control - Exercise
[1]Listener Control: The Listener Control utility (LSNRCTL) is a command-line tool in Oracle databases used to manage the Oracle Net Listener. It enables administrators to start, stop, view the status of, and change the configuration of one or more listeners.
