ORACLE監聽器 The listener supports no services 問題解決方法

kingsql發表於2015-03-05

安裝環境:
作業系統版本:RHCLE5
ORACLE版本:11gR2
開啟監聽器,遠端連線報錯:
ORA-12514: TNS:linstener does not currently know of service requested in connect descriptor
解決問題思路:
檢視監聽器狀態,關閉後重新啟動監聽器
[oracle@rhel5 admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-AUG-2012 19:20:55

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

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

TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/rhel5/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.210)(PORT=1521)))

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.11.210)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                14-AUG-2012 19:20:55
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/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/rhel5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.11.210)(PORT=1521)))
The listener supports no services
The command completed successfully

結果發現錯誤資訊:The listener supports no services

檢視資料庫service_name
> show parameter service

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
service_names                        string      orcl

手工註冊有時能夠解決問題:
> alter system register;
System altered.

檢視監聽器狀態:
[oracle@rhel5 admin]$ lsnrctl start

註冊成功:
[oracle@rhel5 admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-AUG-2012 20:23:26

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rhel5.oraclelinux.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                14-AUG-2012 20:22:49
Uptime                    0 days 0 hr. 0 min. 36 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/rhel5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel5.oraclelinux.com)(PORT=1521)))
Services Summary...
Service "orcl" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

註冊依然失敗:
[oracle@rhel5 admin]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 14-AUG-2012 20:18:02

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=rhel5.oraclelinux.com)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                14-AUG-2012 20:17:45
Uptime                    0 days 0 hr. 0 min. 17 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/rhel5/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=rhel5.oraclelinux.com)(PORT=1521)))
The listener supports no services
The command completed successfully

依然有錯誤資訊:The listener supports no services

重建監聽器:
問題依舊

檢視LISTENER內容:
[oracle@rhel5 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = rhel5.oraclelinux.com)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

在LISTENER裡新增內容:
SID_LIST_LISTENER=
  (SID_LIST=
      (SID_DESC=
                      #BEQUEATH CONFIG
         (GLOBAL_DBNAME=orcl)
         (SID_NAME=orcl)
         (ORACLE_HOME=/u01/app/oracle/product/11.2)
                      #PRESPAWN CONFIG
        (PRESPAWN_MAX=20)
        (PRESPAWN_LIST=
          (PRESPAWN_DESC=(PROTOCOL=tcp)(POOL_SIZE=2)(TIMEOUT=1))
        )
       )
      )

重啟監聽器,問題解決。

 

作者:賈石林
賈石林 部落格 http://stonejia.itpub.net
賈石林 空間 http://space.itpub.net/24234775

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

相關文章