Startup and shutdown of the Oracle lsnrctl------Listener

Source: Internet
Author: User
Tags modifier snmp

Starting and shutting down Oracle listeners is a fundamental task for DBAs, but Linux system administrators or programmers sometimes need to do some basic DBA work in the development database, so it is important for them to understand some basic administrative operations.

This article discusses how to start, close, and view the state of the listener with the LSNRCTL command.

How to start, shut down, and restart an Oracle listener

Ensure that the status of the Oracle listener is checked using the LSNRCTL status command before starting, shutting down, or restarting the Oracle listener. In addition to getting the listener status, you can also get the following information from the output of the Lsnrctl status command:

    • Boot time of the listener
    • Elapsed time of the listener
    • The location of the listener parameter file Listener.ora, usually located in the $oracle_home/network/admin directory
    • Location of listener log files

If the Oracle listener doesn't work, you'll get the following information

[C-sharp]View Plaincopy
  1. $ LSNRCTL Status
  2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:27:39
  3. Copyright (c) 1991, Oracle. All rights reserved.
  4. Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  5. Tns-12541:tns:no Listener
  6. Tns-12560:tns:protocol Adapter Error
  7. Tns-00511:no Listener
  8. Linux Error:111:connection refused
  9. Connecting to (Description= (address= (PROTOCOL=IPC) (Key=extproc)))
  10. Tns-12541:tns:no Listener
  11. Tns-12560:tns:protocol Adapter Error
  12. Tns-00511:no Listener
  13. Linux error:2: No such file or directory

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

[C-sharp]View Plaincopy
  1. $ LSNRCTL Status
  2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:27:02
  3. Copyright (c) 1991, Oracle. All rights reserved.
  4. Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  5. STATUS of the LISTENER
  6. ————————
  7. Alias LISTENER
  8. Version Tnslsnr for linux:version 11.1.0.6.0-production
  9. Start Date 29-apr-2009 18:43:13
  10. Uptime 6 hr. Min. sec
  11. Trace level off
  12. Security on:local OS Authentication
  13. SNMP OFF
  14. Listener Parameter File/u01/app/oracle/product/11.1.0/network/admin/listener.ora
  15. Listener Log File/u01/app/oracle/diag/tnslsnr/devdb/listener/alert/log.xml
  16. Listening Endpoints Summary ...
  17. (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  18. (Description= (address= (PROTOCOL=IPC) (Key=extproc)))
  19. Services Summary ...
  20. Service "Devdb" has 1 instance (s).
  21. Instance "Devdb", status UNKNOWN, have 1 handler (s) for the This service ...
  22. Service "Devdb.thegeekstuff.com" has 1 instance (s).
  23. Instance "Devdb", status ready, have 1 handler (s) for the This service ...
  24. Service "DevdbXDB.thegeekstuff.com" has 1 instance (s).
  25. Instance "Devdb", status ready, have 1 handler (s) for the This service ...
  26. Service "Devdb_XPT.thegeekstuff.com" has 1 instance (s).
  27. Instance "Devdb", status ready, have 1 handler (s) for the This service ...
  28. The command completed successfully

2. Start the Oracle Listener

If the Oracle listener is not running, you can start the Oracle listener with the LSNRCTL Start command, which will start all listeners and, if you only want to start a specific listener, you can specify the listener name after start, for example: Lsnrctl start [ Listener-name].

[C-sharp]View Plaincopy
  1. $ lsnrctl Start
  2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:27:42
  3. Copyright (c) 1991, Oracle. All rights reserved.
  4. Starting/u01/app/oracle/product/11.1.0/bin/tnslsnr:please wait ...
  5. Tnslsnr for linux:version 11.1.0.6.0-production
  6. System parameter file Is/u01/app/oracle/product/11.1.0/network/admin/listener.ora
  7. Log messages Written To/u01/app/oracle/diag/tnslsnr/devdb/listener/alert/log.xml
  8. Listening on: (Description= (Address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  9. Listening on: (Description= (Address= (PROTOCOL=IPC) (Key=extproc)))
  10. Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  11. STATUS of the LISTENER
  12. ————————
  13. Alias LISTENER
  14. Version Tnslsnr for linux:version 11.1.0.6.0-production
  15. Start Date 04-apr-2009 16:27:42
  16. Uptime 0 days 0 hr. 0 min. 0 sec
  17. Trace level off
  18. Security on:local OS Authentication
  19. SNMP OFF
  20. Listener Parameter File/u01/app/oracle/product/11.1.0/network/admin/listener.ora
  21. Listener Log File/u01/app/oracle/diag/tnslsnr/devdb/listener/alert/log.xml
  22. Listening Endpoints Summary ...
  23. (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
  24. (Description= (address= (PROTOCOL=IPC) (Key=extproc)))
  25. Services Summary ...
  26. Service "Devdb" has 1 instance (s).
  27. Instance "Devdb", status UNKNOWN, have 1 handler (s) for the This service ...
  28. The command completed successfully

3. Turn off the Oracle Listener

If the Oracle listener is running, you can use the Lsnrctl Stop command to turn off the Oracle listener, which will shut down all listeners and, if you just want to turn off a specific listener, you can specify the listener name after stop, for example: Lsnrctl stop [ Listener-name]

[C-sharp]View Plaincopy
    1. $ lsnrctl Stop
    2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:27:37
    3. Copyright (c) 1991, Oracle. All rights reserved.
    4. Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
    5. The command completed successfully

4. Restart the Oracle Listener

Restart the listener with Lsnrctl reload, this command can replace Lsnrctl stop and lsnrctl start. Rebooting will read the configuration of the Listener.ora without the need to shut down and start the listener.

[C-sharp]View Plaincopy
    1. $ lsnrctl Reload
    2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 17:03:31
    3. Copyright (c) 1991, Oracle. All rights reserved.
    4. Connecting to (Description= (address= (protocol=tcp) (host=192.168.1.2) (port=1521)))
    5. The command completed successfully

Oracle Listener Help

1. View all listener commands

The Lsnrctl hep command can display all available listener commands. In oracle11g, its output 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 would reload the Oracle Listener SID and parameter files. This is equivalent to Lsnrctl stop and lsnrctl start.
  • Save_config -This would save the current settings to the Listener.ora file and also take a backup of the listener . ora file before overwriting it. If There is no changes, it would display the message "No changes to save for LISTENER"
  • Trace -Enable The tracing at the listener level. The available options is ' Trace OFF ', ' Trace USER ', ' Trace ADMIN ' or ' trace support '
  • Spawn -Spawns a new 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.

[C-sharp]View Plaincopy
  1. $ lsnrctl Help
  2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:12:09
  3. Copyright (c) 1991, Oracle. All rights reserved.
  4. The following operations is available
  5. An asterisk (*) denotes a modifier or extended command:
  6. Start Stop status
  7. Services version Reload
  8. Save_config Trace Spawn
  9. Change_password quit exit
  10. set* show*

2. Get detailed help information for the specified listener command

You can use Lsnrctl help to get the details of the specified command. As shown below

[C-sharp]View Plaincopy
  1. $ lsnrctl Help Show
  2. Lsnrctl for linux:version 11.1.0.6.0-production on 04-apr-2009 16:22:28
  3. Copyright (c) 1991, Oracle. All rights reserved.
  4. The following operations is available after show
  5. An asterisk (*) denotes a modifier or extended command:
  6. Rawmode DisplayMode
  7. Rules Trc_file
  8. Trc_directory Trc_level
  9. Log_file Log_directory
  10. Log_status Current_listener
  11. Inbound_connect_timeout Startup_waittime
  12. Snmp_visible Save_config_on_stop
  13. Dynamic_registration

Startup and shutdown of the Oracle lsnrctl------Listener

Related Article

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.