netca 配置监听遇 use another port number:the information provided for this listener is currently in use 提

来源:互联网 发布:淘宝网上怎么搜索买烟 编辑:程序博客网 时间:2024/05/16 01:33
use another port number:
the information provided for this listener is currently in use by other software 
on this computer.you can proceed with the configuration as it is ,but it will not
be possible to start this listener until the conflict is resolved .would you like 
to continue with the configuration anyway?


今天在复制的虚拟机(已安装 oracle 软件)上配置监听时弹出上述窗口,搜索网上的很多帖子
都说是 1521 端口被占用,执行netstat -an | grep 1521 发现 1521 端口并未被占用,点击“yes”
后,查看监听的状态,发现监听未启动,但是找到了上述报错的原因:


[oracle@dss ~]$ lsnrctl stat


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-MAR-2013 12:36:40


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=prod.oracle.com)(PORT=1521)))
TNS-12545: Connect failed because target host or object does not exist
 TNS-12560: TNS:protocol adapter error
  TNS-00515: Connect failed because target host or object does not exist
   Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
  TNS-00511: No listener
   Linux Error: 111: Connection refuse
   
因为我这台虚拟机是复制的,源主机的 hostname 是 prod.oracle.com,而这里配置的监听 host 正好
是 prod.oracle.com 而非我在复制主机后修改的 dss.oracle.com,经反复排查 /etc/hosts、
/etc/sysconfig/network,/etc/sysconfig/network-scripts/ifcfg-eth0 等配置文件,均未发现配错。
最后尝试修改了一下 $ORAACLE_HOME/network/admin/listener.ora 文件中的 host,将其修改为修改后
新主机名:


LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = dss.oracle.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
  
然后再启动 listener 程序,便可以正常启动了。


[oracle@dss admin]$ lsnrctl start


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-MAR-2013 12:43:46


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


Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/dss/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dss.oracle.com)(PORT=1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dss.oracle.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                02-MAR-2013 12:43:49
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/dss/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dss.oracle.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully


[oracle@dss admin]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 02-MAR-2013 12:44:21


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


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dss.oracle.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                02-MAR-2013 12:43:49
Uptime                    0 days 0 hr. 0 min. 32 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/dss/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dss.oracle.com)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
The listener supports no services
The command completed successfully




监听总算是起来了,但是这里还留有一大疑问:我是在一台机器上安装好 oracle 软件,然后整机复制
,再修改 IP 地址和主机名,为何新机器 netca 配置监听的时候取的 host 是源主机的?
经过最终的排查发现主机的 Oracle 用户 .bash_profile 文件中的 $ORACLE_HOSTNAME 变量还是源主机
并未修改为 dss.oracle.com。这就是 netca 为何在生成 listener.ora 文件时,写入 host=prod.oracle.com 真因。


修改 $ORACLE_HOSTNAME 环境变量设置后,再次使用 netca 配置监听,则不会报任何错误。




转载请注明出处及原文链接,否则拒绝转载:

http://blog.csdn.net/xiangsir/article/details/8632048