2 Day DBA > Managing Network Connections > Stopping and Starting the L...
Stopping and Starting the Listener |
Previous |
Next |
The listener is configured to start automatically when you install Oracle Database Express Edition (Oracle Database XE), and whenever the computer running Oracle Database XE is restarted. The following are reasons why you may want to stop and restart the listener:
To recover from system errors
To temporarily block remote connection requests
You stop the listener to disable remote connection requests, and restart the listener to enable them.
To change the TCP port number that the listener listens on
See "Changing Listener Port Numbers" for more information.
Stopping the Listener
Do one of the following:
On Linux: Start a terminal session and log in to the Oracle Database XE host computer with the oracle
user account.
On Windows: Log in to the Oracle Database XE host computer as the user who installed Oracle Database XE, and then open a command window.
On Linux, ensure that environment variables are set according to the instructions in "Setting Environment Variables on the Linux Platform".
Enter the following command:
LSNRCTL STOP
The command displays the following output if successful.
On Linux:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhost)(PORT=1521))) The command completed successfully
On Windows:
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) The command completed successfully
If the listener was already stopped, the command displays one or more TNS: no listener
messages.
Starting the Listener
Do one of the following:
On Linux: Start a terminal session and log in to the Oracle Database XE host computer with the oracle
user account.
On Windows: Log in to the Oracle Database XE host computer as the user who installed Oracle Database XE, and then open a command window.
On Linux, ensure that environment variables are set according to the instructions in "Setting Environment Variables on the Linux Platform".
Enter the following command:
LSNRCTL START
If successful, the command displays the report shown in "Viewing Listener Status".
Note: If you stop and then start the listener while the database is running, it may take a minute or so for the database to reregister with the listener and to begin accepting connections. To determine if the database is ready to accept connections, run thelsnrctl status command repeatedly until you see the following lines in the report:
Service "XE" has 1 instance(s). Instance "XE", status READY, has 1 handler(s) for this service... |