赞
踩
本文主要向大家介绍了Oracle数据库之oracle监听(lsnrctl)详解解读,通过具体的内容向大家展现,希望对大家学习Oracle数据库有所帮助。
lsnrctl命令常用参数详解:
lsnrctlstart启动指定的监听器
stop关闭指定的监听器
status显示监听器的状态。status命令显示监听器是不是活动的,日志与跟踪文件的位置,监听器已经持续运行了多长时间,以及监听器所监听的任务。如下图所示:services列举监听器的服务信息,比如这些服务是否有任何专用的预生成服务器进程或与之相关的调度进程,以及每个服务已有多少连接被接受或拒绝。这种方法用来检查一个监听器是否在监听一个指定服务。列出服务的一个汇总表及为每个协议服务处理程序所建立和拒绝的连接信息个数。
Version显示oracle net软件与协议适配器的版本。
reload重新装入监听器,重新读取listener.ora文件,但不关闭监听器。如果该文件发生了变化,重新刷新监听器。
save_config当从lsnrctl工具中对listener.ora文件进行了修改时,复制一个叫做listener.bak的listener.ora的文件。
trace打开监听器的跟踪特性。
change_password允许用户修改关闭监听器所需要的密码。
quit退出lsnrctl工具。
exit退出lsnrctl工具。
set*password指定在lsnrctl命令行工具中执行管理任务所需要的密码。
rawmodedisplaymodetrc_file指定监听器跟踪信息的位置。默认设置是$ORACLE_HOMEnetworktracelistener.trc
trc_directorytrc_level跟踪级别OFF – 未启用跟踪功能。OFF 为默认设置。USER – 将跟踪设置为用户的相应级别。跟踪以标识用户导致的错误条件。ADMIN – 将跟踪设置为数据库管理员的相应级别。跟踪以标识特定的安装问题。SUPPORT – 将跟踪设置为客户支持人员的相应级别。 跟踪文件可能会变得很大。Oracle Corporation 建议在不进行网络问题诊断时关闭跟踪功能。
log_file指定一个监听器将把日志信息写到哪里。这个参数在默认的情况下是ON,并默认为%oracle_home%networkloglistener.log
log_directorylog_statuscurrent_listenerinbound_connect_timeout定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
startup_waittime定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
save_config_on_stop指定在一个lsnrctl会话期内所发生的修改在退出时是否应该被保存起来。
show*rawmode显示关于status和service的较详细信息(当他们设置成on时)值为ON或OFF。
displaymode把lsnrctl工具的显示模式设置成raw、compact、normal或verbose服务显示模式为NORMAL
rulestrc_file指定监听器跟踪信息的位置。默认设置是$ORACLE_HOMEnetworktracelistener.trc
current_listener目前的监听器为 listener2inbound_connect_timeout定义监听器在一个会话得到启动时将等待的有效响应时间。默认设置为10秒。
startup_waittime定义监听器在响应lsnrctl命令行工具中的一条status命令之前将等待多长时间。
snmp_visiblesave_config_on_stop指定在一个lsnrctl会话期内所发生的修改在退出时是否应该被保存起来。
lsnrctl部分查询状态详解:
LSNRCTL> statusConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ocm1.oracle.domain)(PORT=1521)))STATUS of the LISTENER————————Alias LISTENERVersion TNSLSNR for Linux: Version 10.2.0.1.0 – ProductionStart Date 17-MAY-2011 21:03:40Uptime 0 days 0 hr. 2 min. 49 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /u01/app/oracle/product/10.2.1/db/network/admin/listener.oraListener Log File /u01/app/oracle/product/10.2.1/db/network/log/listener.logListening Endpoints Summary…(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1522)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1600)))Services Summary…Service “POD” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…Service “POD1″ has 1 instance(s).Instance “POD”, status UNKNOWN, has 1 handler(s) for this service…Service “PODS” has 1 instance(s).Instance “POD”, status READY, has 2 handler(s) for this service…Service “pod_XPT” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…Service “repos” has 2 instance(s).Instance “repos”, status UNKNOWN, has 1 handler(s) for this service…Instance “repos”, status READY, has 1 handler(s) for this service…Service “repos_XPT” has 1 instance(s).Instance “repos”, status READY, has 1 handler(s) for this service…The command completed successfully
status详解
Listening Endpoints Summary…(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1521)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1522)))(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=1600)))
#此处说明该主机地址为ocm1.oracle.domain,开启的监听端口有1521,1522,1600
Services Summary…Service “POD” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…
#此处说明有一个服务名POD的服务,数据库实例名为POD,状态READY说明其目前处于动态注册Service “POD1″ has 1 instance(s).Instance “POD”, status UNKNOWN, has 1 handler(s) for this service…
#此处说明有一个服务名为POD1的服务,数据库的实例名为POD,状态UNKNOWN说明其目前是静态注册Service “PODS” has 1 instance(s).Instance “POD”, status READY, has 2 handler(s) for this service…
#此处说明有一个服务名为PODS的服务,数据库实例名为POD,状态READY说明其是动态注册
Service “repos” has 2 instance(s).Instance “repos”, status UNKNOWN, has 1 handler(s) for this service…Instance “repos”, status READY, has 1 handler(s) for this service…The command completed successfully
#此处说明有一个服务名为repos的服务,对应数据库实例为repos,UNKNOWN,READY状态说明其目前有一个静态注册和一个动态注册
LSNRCTL> servicesConnecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=ocm1.oracle.domain)(PORT=1521)))Services Summary…Service “POD” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVERService “POD1″ has 1 instance(s).Instance “POD”, status UNKNOWN, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0LOCAL SERVERService “PODS” has 1 instance(s).Instance “POD”, status READY, has 2 handler(s) for this service…Handler(s):“D001″ established:0 refused:0 current:0 max:1022 state:readyDISPATCHER(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=37290))“D000″ established:0 refused:0 current:0 max:1022 state:readyDISPATCHER(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=37288))Service “pod_XPT” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVERService “repos” has 2 instance(s).Instance “repos”, status UNKNOWN, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0LOCAL SERVERInstance “repos”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVERService “repos_XPT” has 1 instance(s).Instance “repos”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVERThe command completed successfully
service详解
Service “POD” has 1 instance(s).Instance “POD”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVER
#名为POD的服务,对应数据库实例为POD,状态READY说明其处于动态注册
DEDICATED” established:0 refused:0 state:ready说明是专有连接,连接数为0拒绝数为0,状态:动态Service “POD1″ has 1 instance(s).Instance “POD”, status UNKNOWN, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0LOCAL SERVER
#名为POD1的服务,对应数据库实例为POD,状态UNKNOWN说明其处于静态注册
DEDICATED” established:2 refused:0说明是专有连接,连接数为2拒绝数为0Service “PODS” has 1 instance(s).Instance “POD”, status READY, has 2 handler(s) for this service…Handler(s):“D001″ established:0 refused:0 current:0 max:1022 state:readyDISPATCHER(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=37290))“D000″ established:0 refused:0 current:0 max:1022 state:readyDISPATCHER(ADDRESS=(PROTOCOL=tcp)(HOST=ocm1.oracle.domain)(PORT=37288))
#名为PODS的服务,对应数据库实例名为POD的数据库,READY状态说明其为动态注册
“D001″ established:0 refused:0 current:0 max:1022 state:ready
”D000″ established:0 refused:0 current:0 max:1022 state:ready
这里说明其为share模式,目前,两个dispatcher目前都连接为0,拒绝为0,最大数为1022,状态是动态注册
——————————————————————————————————————————————————————
对应sql查询
SQL> show parameter dispatchers
NAME TYPE VALUE———————————— ———– ——————————dispatchers stringmax_dispatchers integerSQL> alter system set dispatchers=’(protocol=tcp) (dispatchers=2)’;System altered.SQL> show parameter dispatchersNAME TYPE VALUE———————————— ———– ——————————dispatchers string (protocol=tcp) (dispatchers=2)max_dispatchers integerSQL> select name,network,paddr,status from v$dispatcher;NAME NETWORK PADDR STATUS—- ——————————————————————————– ——– —————-D000 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=37288)) 2A220390 WAITD001 (ADDRESS=(PROTOCOL=tcp)(HOST=seagull)(PORT=37290)) 2A220948 WAIT
——————————————————————————————————————————————————————
Service “repos” has 2 instance(s).Instance “repos”, status UNKNOWN, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0LOCAL SERVERInstance “repos”, status READY, has 1 handler(s) for this service…Handler(s):“DEDICATED” established:0 refused:0 state:readyLOCAL SERVER
#repos服务对应的实例有2个,但此处都为实例repos,一个为静态UNKNOWN,一个为动态READY,目前连接数都为0,拒绝也为0The command completed successfully
本文由职坐标整理并发布,希望对同学们学习Oracle有所帮助,更多内容请关注职坐标数据库Oracle数据库频道!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。