一次Oracle監聽無法動態註冊處理過程排查分析

yingyifeng306發表於2023-10-07

在之前的文章探討過監聽無法動態註冊的問題,這一次又在不同的客戶中碰到了相同的問題,遂記錄之。
    客戶反映他的資料庫無法動態註冊監聽,監聽狀態顯示如下
    引用
    $ lsnrctl status

LSNRCTL for HPUX: Version 10.2.0.3.0 – Production on 10-JUN-2011 16:38:16

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=130.123.12.89)(PORT=1521)))
    STATUS of the LISTENER
    ————————
    Alias LISTENER
    Version TNSLSNR for HPUX: Version 10.2.0.3.0 – Production
    Start Date 10-JUN-2011 16:35:38
    Uptime 0 days 0 hr. 2 min. 38 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File /oracle/app/product/10.2/network/admin/listener.ora
    Listener Log File /oracle/app/product/10.2/network/log/listener.log
    Listening Endpoints Summary…
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=130.123.12.89)(PORT=1521)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC0)))
    Services Summary…
    Service "PLSExtProc" has 1 instance(s).
    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:
    #
    #
    # 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,再執行手動註冊監聽即可。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23732248/viewspace-2987187/,如需轉載,請註明出處,否則將追究法律責任。

相關文章