日期:2014-05-16  浏览次数:20498 次

Oracle监听器的常用操作手册

      纲:

LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:

start               stop                status              
services            version             reload              
save_config         trace               spawn               
change_password     quit                exit                
set*                show*               

      ps -ef|grep tnslsnr 
      列出进程
      
      netstat -lntp 或者 -a
      查看端口
      
      lsnrctl start
      启动指定监听器,后面可接监听名,若无,则为缺省
      
      lsnrctl stop
      意思同上,只把启动换关闭
      
      lsnrctl status
      显示监听器的状态,包括:监听是否活动,参数文件与日志文件的位置,已经运行的时间,以及监听的任务

[oracle@Think ~]$ lsnrctl status

LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 25-JAN-2013 12:45:24

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.112)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date                25-JAN-2013 12:13:27
Uptime                    0 days 0 hr. 31 min. 56 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.112)(PORT=1521)))
Services Summary...
Service "orcl.oracle.com" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

      lsnrctl Services
      用来检查一个监听器是否在监听一个指定服务

LSNRCTL> services
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.112)(PORT=1521)))
Services Summary...
Service "orcl.oracle.com" has 1 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:2 refused:0
         LOCAL SERVER
The command completed successfully

       lsnrctl Version
       显示Oracle Net和网卡的版本
       
       lsnrctl reload
       重新读取listener.ora,但不关闭监听器,和刷新相去无几
       
       save_config
       当用lsnrctl对listener.ora进行修改时,复制一份叫listener.bak的listener.ora的文件
       
       change_password
       允许用户修改关闭监听器所需的密码
       
       trace
      &n