啟動監聽報TNS-01150錯誤處理

super_sky發表於2014-01-11

在一個SAP業務的應用中,資料庫正常重啟後,發現監聽無法啟動。報如題的錯誤。

bfbwapp3:orabwd 4> lsnrctl start

LSNRCTL for HPUX: Version 11.2.0.3.0 - Production on 11-JAN-2014 23:21:54

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

Starting /oracle/BWD/11203/bin/tnslsnr: please wait...

TNSLSNR for HPUX: Version 11.2.0.3.0 - Production
System parameter file is /oracle/BWD/11203/network/admin/listener.ora
Log messages written to /oracle/BWD/saptrace/diag/tnslsnr/bfbwapp3/listener/alert/log.xml
TNS-01150: The address of the specified listener name is incorrect

Listener failed to start. See the error message(s) above...

從錯誤資訊看,監聽的名稱不正確。

檢查一下是否有其他監聽啟動

bfbwapp3:orabwd 5>
bfbwapp3:orabwd 5> ps -ef | grep tns 
  orabwd  5940  4928  0 23:22:13 pts/1     0:00 grep tns
沒有其他的監聽啟動,進一步的檢查監聽的配置檔案

################^M
# Filename......: listener.ora^M
# Created.......: created by SAP AG, R/3 Rel. >= 6.10^M
# Name..........:^M
# Date..........:^M
# @(#) $Id: //bc/700-1_REL/src/ins/SAPINST/impl/tpls/ora/ind/LISTENER.ORA#4 $^M
################^M
ADMIN_RESTRICTIONS_LISTENER = on^M
LISTENER =^M (ADDRESS_LIST =^M (ADDRESS =^M (PROTOCOL = IPC)^M (KEY = BWD.WORLD)^M )^M (ADDRESS=^M (PROTOCOL = IPC)^M (KEY = BWD)^M )^M (ADDRESS =^M (COMMUN
ITY = SAP.WORLD)^M (PROTOCOL = TCP)^M (HOST = bfbwapp3)^M (PORT = 1527)^M )^M )^M
  (ADDRESS_LIST =^M
        (ADDRESS =^M
          (PROTOCOL = IPC)^M
          (KEY = BWD.WORLD)^M
        )^M
        (ADDRESS=^M
          (PROTOCOL = IPC)^M
          (KEY = BWD)^M
        )^M
        (ADDRESS =^M
          (COMMUNITY = SAP.WORLD)^M
          (PROTOCOL = TCP)^M
          (HOST = bfbwapp3)^M
          (PORT = 1527)^M
        )^M
  )^M
STARTUP_WAIT_TIME_LISTENER = 0^M
CONNECT_TIMEOUT_LISTENER = 10^M
TRACE_LEVEL_LISTENER = OFF^M
SID_LIST_LISTENER =^M (SID_LIST =^M (SID_DESC =^M (SID_NAME = BWD)^M (ORACLE_HOME = /oracle/BWD/11203)^M )^M )^M
  (SID_LIST =^M
    (SID_DESC =^M
      (SID_NAME = BWD)^M
      (ORACLE_HOME = /oracle/BWD/11203)^M
    )^M
  )^M
/

這個監聽檔案好亂啊,仔細檢查發現幾個問題

1)首先去掉^M這個符號

使用vi 然後輸入 :%s/^M/ /g (這裡要說明的是 ^M的輸入是 Ctrl+V+M輸入^M)

2)檢查 listener name 和 sid_list_name 中兩個名字是否一致

檢查發現name一致

3)仔細檢查監聽檔案

發現這段存在問題

SID_LIST_LISTENER =^M (SID_LIST =^M (SID_DESC =^M (SID_NAME = BWD)^M (ORACLE_HOME = /oracle/BWD/11203)^M )^M )^M
  (SID_LIST =^M
    (SID_DESC =^M
      (SID_NAME = BWD)^M
      (ORACLE_HOME = /oracle/BWD/11203)^M
    )^M
  )^M

兩端SID_LIST內容完全一致,刪除其中一部分,這個問題就解決了。

修改後的配置檔案

bfbwapp3:orabwd 35> cat listener.ora
################
# Filename......: listener.ora
# Created.......: created by SAP AG, R/3 Rel. >= 6.10
# Name..........:
# Date..........:
# @(#) $Id: //bc/700-1_REL/src/ins/SAPINST/impl/tpls/ora/ind/LISTENER.ORA#4 $
################
ADMIN_RESTRICTIONS_LISTENER = on
LISTENER = 
(ADDRESS_LIST = 
        (ADDRESS =  (PROTOCOL = IPC)  (KEY = BWD.WORLD)  ) 
        (ADDRESS=  (PROTOCOL = IPC)  (KEY = BWD)  )  (ADDRESS =  (COMMUNITY = SAP.WORLD)  (PROTOCOL = TCP)  (HOST = bfbwapp3)  (PORT = 1527)  )
)
(ADDRESS_LIST =
        (ADDRESS =
          (PROTOCOL = IPC)
          (KEY = BWD.WORLD)
        )
        (ADDRESS=
          (PROTOCOL = IPC)
          (KEY = BWD)
        )
        (ADDRESS =
          (COMMUNITY = SAP.WORLD)
          (PROTOCOL = TCP)
          (HOST = bfbwapp3)
          (PORT = 1527)
        )
  )
STARTUP_WAIT_TIME_LISTENER = 0
CONNECT_TIMEOUT_LISTENER = 10
TRACE_LEVEL_LISTENER = OFF
SID_LIST_LISTENER =  (SID_LIST =  (SID_DESC =  (SID_NAME = BWD)  (ORACLE_HOME = /oracle/BWD/11203)  )  )
ADR_BASE_LISTENER = /oracle/BWD/saptrace
#----ADDED BY TNSLSNR 03-JAN-2014 11:14:44---
# PASSWORDS_LISTENER =   REMOVED BY TNSLSNR 03-JAN-2014 11:17:14
#--------------------------------------------

啟動後的狀態

bfbwapp3:orabwd 33> lsnrctl start

LSNRCTL for HPUX: Version 11.2.0.3.0 - Production on 11-JAN-2014 23:36:14

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

Starting /oracle/BWD/11203/bin/tnslsnr: please wait...

TNSLSNR for HPUX: Version 11.2.0.3.0 - Production
System parameter file is /oracle/BWD/11203/network/admin/listener.ora
Log messages written to /oracle/BWD/saptrace/diag/tnslsnr/bfbwapp3/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=BWD.WORLD)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=BWD)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bfbwapp3)(PORT=1527)))

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=BWD.WORLD))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for HPUX: Version 11.2.0.3.0 - Production
Start Date                11-JAN-2014 23:36:17
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/BWD/11203/network/admin/listener.ora
Listener Log File         /oracle/BWD/saptrace/diag/tnslsnr/bfbwapp3/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=BWD.WORLD)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=BWD)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=bfbwapp3)(PORT=1527)))
Services Summary...
Service "BWD" has 1 instance(s).
  Instance "BWD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

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

相關文章