Listener

Linux 錯誤:111:連接被拒絕 LSNRCTL

  • June 18, 2015

我在啟動監聽器時遇到問題,我使用的是 Centos 6.5 和 Oracle 12cR1。

數據庫已成功安裝。

現在我的問題是當我啟動我的監聽器時,會顯示以下錯誤:

LSNRCTL> service
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gaurav)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
  Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
Services Summary...
Service "tuts" has 1 instance(s).
Instance "tuts", status UNKNOWN, has 1 handler(s) for this service...
Handler(s):
 "DEDICATED" established:0 refused:0
    LOCAL SERVER
The command completed successfully

我的主機名是gaurav

hosts所以我在文件中創建一個條目

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.1.1        gaurav      oracle

另外,我創建了一個 listener.ora 文件,內容如下:

LISTENER =
 (DESCRIPTION_LIST =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =gaurav)(PORT = 1521))
     (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
   )
 )

sid_list_listener=
  (sid_list=
  (sid_desc=
  (oracle-home=/home/oracle/app/oracle/product/12.1.0/dbhome_1)
  (sid_name=tuts)))

我能夠 ping 我的主機gaurav

誰能幫我解決這個問題?

編輯

[oracle@gaurav ~]$ lsnrctl start

LSNRCTL for Linux: Version 12.1.0.1.0 - Production on 05-JUN-2014 22:38:57

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

Starting /home/oracle/app/oracle/product/12.1.0/dbhome_1/bin/tnslsnr:  please wait...

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=gaurav)(PORT=1521)))
 TNS-12541: TNS:no listener
 TNS-12560: TNS:protocol adapter error
 TNS-00511: No listener
 Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 12.1.0.1.0 - Production
Start Date                05-JUN-2014 22:38:59
Uptime                    0 days 0 hr. 0 min. 1 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /home/oracle/app/oracle/product/12.1.0/dbhome_1 /network/admin/listener.ora
Listener Log File         /home/oracle/app/oracle/diag/tnslsnr/gaurav /listener/alert/log.xml
Listening Endpoints Summary...
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=gaurav)(PORT=1521)))
 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Services Summary...
Service "tuts" has 1 instance(s).
Instance "tuts", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully

對我來說,您似乎沒有啟動偵聽器,但它已啟動。您的問題似乎是 tcp 連接而不是 ipc。所以監聽器正在執行,你無法使用 tcp 訪問它。使用telnet gaurav 1521

如果 telnet 沒有提供連接,則防火牆正在阻止您。停止/編輯防火牆。

引用自:https://dba.stackexchange.com/questions/66568