首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

记一次Oracle监听没法动态注册处理

2012-07-30 
记一次Oracle监听无法动态注册处理在之前的文章中http://itspace.iteye.com/blog/1055532探讨过监听无法动

记一次Oracle监听无法动态注册处理
在之前的文章中http://itspace.iteye.com/blog/1055532探讨过监听无法动态注册的问题,这一次又在不同的客户中碰到了相同的问题,遂记录之。
客户反映他的数据库无法动态注册监听,监听状态显示如下
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "wesrmirr" has 1 instance(s).
  Instance "wesrmirr", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
可以看到监听端口为1521,而且local_listner参数为空,
引用SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string
log_archive_local_first              boolean     TRUE
在这种情况下,理论上pmon会将实例状态动态注册至监听中。
手动发起监听注册,也没有作用,监听状态依旧。
引用SQL> alter system register;

System altered.

于是检查数据库检查日志,在启动日志出现无效地址字样
引用PMON started with pid=3, OS id=2521
Fri Jun 10 16:33:25 2011
ORA-00130: invalid listener address '(ADDRESS=(PROTOCOL=TCP)(HOST=unknown)(PORT=1521))'
PSP0 started with pid=2, OS id=2526
进一步检查listener.ora文件和/etc/hosts文件
引用SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /oracle/app/product/10.2)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = wesrmirr)
      (ORACLE_HOME = /oracle/app/product/10.2)
      (SID_NAME = wesrmirr)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 130.123.12.89)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
    )
  )
可以看到ip地址130.123.12.89并没有出现在/etc/hosts配置文件中
引用$ more /etc/hosts
# @(#)B11.23_LRhosts $Revision: 1.9.214.1 $ $Date: 96/10/08 13:20:01 $
#
# The form for each entry is:
# <internet address>    <official hostname> <aliases>
#
# For example:
# 192.1.2.34    hpfcrm  loghost
#
# See the hosts(4) manual page for more information.
# Note: The entries cannot be preceded by a space.
#       The format described in this file is the correct format.
#       The original Berkeley manual page contains an error in
#       the format description.
#
127.0.0.1       localhost       loopback
130.123.12.2      wesr-S-YWMIRROR

找到原因之后,解决方法也变得很简单,只要将130.123.12.89添加至/etc/hosts,再执行手动注册监听即可。

热点排行