Thursday, October 29, 2015

How To Start, Stop and Restart Oracle Listener

For a database administrator, starting up and shutting down the oracle listener is a routine task .

Displaying oracle listener status:

Before starting, stopping or restarting make sure to execute lsnrctl status command to check the oracle listener status as shown below. Apart from letting us know whether the listener is up or down, you can also find the following valuable information from the lsnrctl status command output.

    Listner Start Date and Time.
    Uptime of listner – How long the listener has been up and running.
    Listener Parameter File – Location of the listener.ora file. Typically located under $ORACLE_HOME/network/admin
    Listener Log File – Location of the listener log file. i.e log.xml

command: $ lsnrctl status

Starting oralce listener:

If the Oracle listener is not running, start the listener as shown below. This will start all the listeners. If you want to start a specific listener, specify the listener name next to start. i.e lsnrctl start [listener-name]

command: $ lsnrctl start

Stoppping listener:

If the Oracle listener is running, stop the listener as shown below. This will stop all the listeners. If you want to stop a specific listener, specify the listener name next to stop. i.e lsnrctl stop [listener-name]

command: $ lsnrctl stop

Restarting listener:

To restart the listener use lsnrctl reload as shown below instead of lsnrctl stop and lsnrctl start. realod will read the listener.ora file for new setting without stop and start of the Oracle listener.

command: $ lsnrctl reload


Available listener commands:

lsnrctl help command will display all available listener commands. In Oracle 11g following are the available listener commands.

    start – Start the Oracle listener
    stop – Stop the Oracle listener
    status – Display the current status of the Oracle listener
    services – Retrieve the listener services information
    version – Display the oracle listener version information
    reload – This will reload the oracle listener SID and parameter files. This is equivalent to lsnrctl stop and lsnrctl start.
    save_config – This will save the current settings to the listener.ora file and also take a backup of the listener.ora file before overwriting it. If there are no changes, it will display the message “No changes to save for LISTENER”
    trace – Enable the tracing at the listener level. The available options are ‘trace OFF’, ‘trace USER’, ‘trace ADMIN’ or ‘trace SUPPORT’
    spawn – Spawns a new with the program with the spawn_alias mentioned in the listener.ora file
    change_password – Set the new password to the oracle listener (or) change the existing listener password.
    show – Display log files and other relevant listener information.

No comments: