当前位置:   article > 正文

lsnrctl使用大全

lsnrctl status这么用

lsnrctl start    启动指定的监听器
lsnrctl stop   
关闭指定的监听器
lsnrctl status  
显示监听器的状态。

以上仅限单机版本下的操作,RAC下要用crsctl或者srvctl来管理监听。 

status命令显示监听器是不是活动的,日志与跟踪文件的位置,监听器已经持续运行了多长时间,以及监听器所监听的任务。
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 03-JUN-2013 15:55:00

 

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

 

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production

Start Date                03-JUN-2013 10:57:39

Uptime                    0 days 4 hr. 57 min. 21 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File   /app/grid/11.2.0/network/admin/listener.ora

Listener Log File         /app/grid/crs/diag/tnslsnr/rac02/listener/alert/log.xml

Listening Endpoints Summary...

  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.202)(PORT=1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.205)(PORT=1521)))

Services Summary...

Service "+ASM" has 1 instance(s).

  Instance "+ASM2", status READY, has 1 handler(s) for this service...

Service "racdb" has 1 instance(s).

  Instance "racdb2", status READY, has 1 handler(s) for this service...

Service "racdbXDB" has 1 instance(s).

  Instance "racdb2", status READY, has 1 handler(s) for this service...

The command completed successfully

 

services
列举监听器的服务信息,比如这些服务是否有任何专用的预生成服务器进程或与之相关的调度进程,以及每个服务已有多少连接被接受或拒绝。这种方法用来检查一个监听器是否在监听一个指定服务。
列出服务的一个汇总表及为每个协议服务处理程序所建立和拒绝的连接信息个数。
LSNRCTL> services racdb

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=racdb-scan)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=racdb)))

Services Summary...

Service "racdb" has 2 instance(s).

  Instance "racdb1", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:4 refused:0 state:ready

         REMOTE SERVER

         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac01-vip)(PORT=1521)))

  Instance "racdb2", status READY, has 1 handler(s) for this service...

    Handler(s):

      "DEDICATED" established:5 refused:0 state:ready

         REMOTE SERVER

         (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rac02-vip)(PORT=1521)))

Service "racdbXDB" has 2 instance(s).

  Instance "racdb1", status READY, has 1 handler(s) for this service...

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready

         DISPATCHER

         (ADDRESS=(PROTOCOL=tcp)(HOST=rac01)(PORT=9358))

  Instance "racdb2", status READY, has 1 handler(s) for this service...

    Handler(s):

      "D000" established:0 refused:0 current:0 max:1022 state:ready

         DISPATCHER

         (ADDRESS=(PROTOCOL=tcp)(HOST=rac02)(PORT=40073))

The command completed successfully

 

version
显示oracle net软件与协议适配器的版本


reload
重新装入监听器,重新读取listener.ora文件,但不关闭监听器。如果该文件发生了变化,重新刷新监听器。


save_config
当从lsnrctl工具中对listener.ora文件进行了修改时,复制一个叫做listener.baklistener.ora的文件


trace
打开监听器的跟踪特性


change_password
允许用户修改关闭监听器所需要的密码


quit
退出lsnrctl实用工具


exit
退出lsnrctl实用工具


set*
password
指定在lsnrctl命令行工具中执行管理任务所需要的密码
rawmode
displaymode
trc_file

指定监听器跟踪信息的位置。默认设置是$ORACLE_HOME\network\trace\listener.trc
trc_directory
trc_level

跟踪级别 
OFF - 未启用跟踪功能。OFF 为默认设置。 

USER - 将跟踪设置为用户的相应级别。跟踪以标识用户导致的错误条件。 

ADMIN - 将跟踪设置为数据库管理员的相应级别。跟踪以标识特定的安装问题。 

SUPPORT - 将跟踪设置为客户支持人员的相应级别。 跟踪文件可能会变得很大。

Oracle Corporation 建议在不进行网络问题诊断时关闭跟踪功能。

log_file
指定一个监听器将把日志信息写到哪里。这个参数在默认的情况下是ON,并默认为%oracle_home%\network\log\listener.log
log_directory
log_status
current_listener
inbound_connect_timeout

定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
startup_waittime
定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
save_config_on_stop
指定在一个lsnrctl会话期内所发生的修改在退出时是否应该被保存起来。
show*
rawmode

显示关于statusservice的较详细信息(当他们设置成on时)值为ONOFF
displaymode
lsnrctl工具的显示模式设置成rawcompactnormalverbose
服务显示模式为NORMAL
rules
trc_file

指定监听器跟踪信息的位置。默认设置是$ORACLE_HOME\network\trace\listener.trc
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=linux)(PORT=3521)))
listener2 参数 \trc_file\ 被设为 listener2.trc

命令执行成功
trc_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "trc_directory" set to /app/grid/crs/diag/tnslsnr/rac02/listener/trace

The command completed successfully
trc_level
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "trc_level" set to off

The command completed successfully
log_file
指定一个监听器将把日志信息写到哪里。这个参数在默认的情况下是ON,并默认为%oracle_home%\network\log\listener.log
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "log_file" set to /app/grid/crs/diag/tnslsnr/rac02/listener/alert/log.xml

The command completed successfully
log_directory
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "log_directory" set to /app/grid/crs/diag/tnslsnr/rac02/listener/alert

The command completed successfully
log_status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "log_status" set to ON

The command completed successfully
current_listener
目前的监听器为 listener2
inbound_connect_timeout
定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
$ oerr ora 12525
12525, 00000, "TNS:listener has not received client's request in time allowed"
// *Cause: The listener disconnected the client because the client failed to
// provide the necessary connect information within the allowed time interval.
// This may be a result of network/system delays; or this may indicate that a
// malicious client is trying to cause a Denial of Service attack on the
// listener.
// *Action: If the error occurred because of a slow network/system,
// reconfigure INBOUND_CONNECT_TIMEOUT to a larger value. If a malicious
// client is suspected, use the address in listener.log to identify the
// source and restrict access. Turn on tracing for more information.
// *Comment: The logged address in listener.log may not be reliable as it
// can be forged at the lower networking layers (e.g. in the case of TCP/IP).
startup_waittime
定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "startup_waittime" set to 0

The command completed successfully

snmp_visible
save_config_on_stop
指定在一个lsnrctl会话期内所发生的修改在退出时是否应该被保存起来。
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))

LISTENER parameter "save_config_on_stop" set to OFF

The command completed successfully

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9399028/viewspace-762849/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9399028/viewspace-762849/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/85805
推荐阅读
  

闽ICP备14008679号