Oracle LSNRCTL-listener startup and Shutdown

Source: Internet
Author: User

For DBAs, starting and disabling Oracle listeners is a basic task, but Linux system administrators or Programmers sometimes need to perform some basic DBA operations in the development database, therefore, it is important for them to understand some basic management operations.

This article will discuss how to use the LSNRCTL command to start, close, and view the listener status.

 

How to start, close, and restart the Oracle listener

Before starting, disabling, or restarting the Oracle listener, make sure to use the lsnrctl status Command to check the Oracle listener status. In addition to obtaining the listener status, you can also obtain the following information from the output of the LSNRCTL status command:

  • Listener Start Time
  • Listener running time
  • Location of the listener. ora listener parameter file, usually in the $ ORACLE_HOME/Network/Admin directory
  • Location of the listener Log File

 

If the Oracle listener is useless, you will get the following information:

$ LSNRCTL status </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:27:39 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> connecting to (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521) <br/> TNS-12541: TNS: no listener <br/> TNS-12560: TNS: protocol adapter error <br/> TNS-00511: No listener <br/> Linux error: 111: connection refused <br/> connecting to (description = (address = (Protocol = IPC) (Key = EXTPROC) <br/> TNS-12541: TNS: no listener <br/> TNS-12560: TNS: protocol adapter error <br/> TNS-00511: No listener <br/> Linux error: 2: no such file or directory </P> <p>

 

If the Oracle listener is running, you will get the following information:

$ LSNRCTL status </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:27:02 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> connecting to (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521 ))) <br/> Status of the listener <br/> -------- <br/> alias listener <br/> Version tnslsnr for Linux: Version 11.1.0.6.0-production <br/> Start Date 29-apr-2009 18:43:13 <br/> uptime 6 days 21 HR. 43 min. 49 sec <br/> Trace Level off <br/> Security on: local OS authentication <br/> SNMP off <br/> listener parameter file/u01/APP/Oracle/product/11.1.0/Network/admin/listener. ora <br/> listener log file/u01/APP/Oracle/diag/tnslsnr/devdb/listener/alert/log. XML <br/> listening endpoints Summary... <Br/> (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521 ))) <br/> (description = (address = (Protocol = IPC) (Key = EXTPROC) <br/> services Summary... <Br/> service "devdb" has 1 instance (s). <br/> instance "devdb", status unknown, has 1 handler (s) for this service... <Br/> service "devdb.thegeekstuff.com" has 1 instance (s). <br/> instance "devdb", status ready, has 1 handler (s) for this service... <Br/> service "devdbxdb.thegeekstuff.com" has 1 instance (s). <br/> instance "devdb", status ready, has 1 handler (s) for this service... <Br/> service "devdb_xpt.thegeekstuff.com" has 1 instance (s). <br/> instance "devdb", status ready, has 1 handler (s) for this service... <Br/> the command completed successfully

 

2. Start the Oracle listener

If the Oracle listener is useless, you can use the LSNRCTL start command to start the Oracle listener. This command will start all the listeners. If you only want to start a specific listener, you can specify the listener name after start, for example, LSNRCTL start [listener-name].

$ LSNRCTL start </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:27:42 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> starting/u01/APP/Oracle/product/11.1.0/bin/tnslsnr: Please wait... </P> <p> tnslsnr for Linux: Version 11.1.0.6.0-production <br/> system parameter file is/u01/APP/Oracle/product/11.1.0/Network/admin/listener. ora <br/> log messages written to/u01/APP/Oracle/diag/tnslsnr/devdb/listener/alert/log. XML <br/> listening on: (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521) <br/> listening on: (description = (address = (Protocol = IPC) (Key = EXTPROC) </P> <p> Conn Ecting to (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521 ))) <br/> Status of the listener <br/> -------- <br/> alias listener <br/> Version tnslsnr for Linux: version 11.1.0.6.0-production <br/> Start Date 04-apr-2009 16:27:42 <br/> uptime 0 days 0 HR. 0 min. 0 sec <br/> Trace Level off <br/> Security on: Local OS authentication <br/> SNMP off <br/> listener parameter file/u01/APP/Oracle /Product/11.1.0/Network/admin/listener. ora <br/> listener log file/u01/APP/Oracle/diag/tnslsnr/devdb/listener/alert/log. XML <br/> listening endpoints Summary... <Br/> (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521 ))) <br/> (description = (address = (Protocol = IPC) (Key = EXTPROC) <br/> services Summary... <Br/> service "devdb" has 1 instance (s). <br/> instance "devdb", status unknown, has 1 handler (s) for this service... <Br/> the command completed successfully

 

3. Disable the Oracle listener

If the Oracle listener is running, you can use the LSNRCTL Stop command to disable the Oracle listener. This command will disable all listeners. If you only want to disable a listener, you can stop the listener and specify the name of the listener, example: LSNRCTL stop [listener-name]

$ LSNRCTL stop </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:27:37 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> connecting to (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521) <br/> the command completed successfully

 

4. Restart the Oracle listener.

Use lsnrctl reload to restart the listener. This command can replace LSNRCTL stop and LSNRCTL start. The listener. ora configuration will be read when you do not need to close or start the listener.

$ Lsnrctl reload </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 17:03:31 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> connecting to (description = (address = (Protocol = TCP) (host = 192.168.1.2) (Port = 1521) <br/> the command completed successfully

 

Oracle listener help

1. View All listener commands

The LSNRCTL command displays all available listener commands. The output in oracle11g is as follows:

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

    $ LSNRCTL help </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:12:09 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> the following operations are available <br/> An asterisk (*) denotes a modifier or extended command: </P> <p> Start Stop status <br/> services version reload <br/> save_config trace spawn <br/> change_password quit exit <br/> Set * show *

     

    2. Get detailed help information for the specified listener command.

    You can use LSNRCTL help to obtain detailed help information for the specified command. As shown below

    $ LSNRCTL help show </P> <p> LSNRCTL for Linux: Version 11.1.0.6.0-production on 04-apr-2009 16:22:28 </P> <p> copyright (c) 1991,200 7, Oracle. all rights reserved. </P> <p> the following operations are available after show <br/> An asterisk (*) denotes a modifier or extended command: </P> <p> rawmode displaymode <br/> rules TRC_FILE <br/> trc_directory trc_level <br/> LOG_FILE log_directory <br/> log_status current_listener <br/> inbound_connect_timeout startup_waittime <br/> snmp_visible save_config_on_stop <br/> dynamic_registration

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.