Stopping and Starting the Listener

Previous
Previous
Next
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:

Stopping the Listener

To stop the listener:

  1. 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.

  2. On Linux, ensure that environment variables are set according to the instructions in "Setting Environment Variables on the Linux Platform".

  3. 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

To start the listener:

  1. 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.

  2. On Linux, ensure that environment variables are set according to the instructions in "Setting Environment Variables on the Linux Platform".

  3. 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 the lsnrctl 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...