Lesson 4 | Using the Listener Control program |
Objective | View status of listener using the Listener Control program |
Using Oracle Listener Control Program
Just as SQLPlus is used to start, stop, and manage an Oracle database, Oracle provides a command-line utility known as
Listener Control[1] to start, stop, and manage the Oracle Net Listener. The executable name for Listener Control will be one of the following:
The Oracle tool used to start, stop, and manage an Oracle database is called SQL*Plus.
SQL*Plus is a command-line tool that provides an interface to the Oracle Database.
It is typically installed with the Oracle database server and client software. Here are some of the primary functionalities provided by SQL*Plus:
- Start the Database: To start an Oracle database, the command 'STARTUP' is used in SQL*Plus. This command initiates the instance and mounts and opens the database.
- Stop the Database: The 'SHUTDOWN' command is used in SQL*Plus to stop an Oracle database. There are several shutdown modes, including IMMEDIATE, TRANSACTIONAL, and NORMAL, each of which determines how ongoing transactions are handled before the shutdown.
- Database Management: SQL*Plus allows administrators to execute SQL commands for database management. These could include creating, altering, or dropping database structures like tables, views, indexes, etc. It also allows executing PL/SQL blocks for procedural database programming.
To use SQL*Plus, one needs to open a command prompt (on Windows) or terminal (on Unix/Linux), type 'sqlplus', and log in with a valid Oracle database username and password. While SQLPlus is a powerful tool, it should be used carefully, especially when issuing commands that modify database structures or data. Only authorized users, such as database administrators, should have access to SQLPlus because of the potential impact on the database's operation and data integrity.
Three useful commands
Try starting up your listener control now.
We are going to cover three Listener Control commands :
HELP
,
STATUS
, and
EXIT
.
HELP
and EXIT
are easy ones. HELP
gets you information about the commands you can use, and EXIT
is used to quit the Listener Control program. You will use the STATUS
command to report the current status of the listener. Try the following simulation to practice using all three of these commands.
Using the Listener Control Program
- We will start this simulation from the DOS prompt. Go ahead and type the
lsnrctl
command, and press the ENTER key.
- The listener control program has started, and you have a prompt. Type in
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 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 do not need to worry about that now. Just type
status
to get a display showing the current status of the listener.
- The status display shows you several things, including: the time the listener was started, how long it has been up and
running, what the current trace level is, and the location of the listener parameter and log files. At the bottom you will
see a list of services that this listener is listening for. These usually represent databases. When you are done looking at
the status, type the
exit
command to exit the Listener Control program.
- You are now back at the DOS prompt. This is the end of the simulation.
Legacy Technology
lsnrctl | Unix, and Windows beginning with the release of Oracle8i |
lsnrctl30 | Oracle8, release 8.0.x on Windows |
lsnrctl23 | Oracle7, release 7.3.x on Windows |
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.