Oracle-11g-R2
SQLPlus“無偵聽器”僅與來自 Windows 的遠端連接
- Oracle 數據庫在 linux 伺服器上執行。
- lsnrctl 服務正在執行。
- 在本地,我可以從 sqlplus 和 sql developer 連接到數據庫。
- 遠端,從Windows,我無法連接。
- Windows 上的 sqlplus 表示上面的圖像顯示。
- sql developer 說網路適配器無法建立連接。
- 我已經完成了從 windows 機器到 linux 伺服器的 ping 操作,一切正常。
lsnrctl 狀態:
[oracle@oracledb ~]$ lsnrctl status LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 21-SEP-2015 19:30:58 Copyright (c) 1991, 2009, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production Start Date 21-SEP-2015 16:43:32 Uptime 0 days 2 hr. 47 min. 26 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/oracledb/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521))) Services Summary... Service "mondev" has 1 instance(s). Instance "mondev", status READY, has 1 handler(s) for this service... Service "mondevXDB" has 1 instance(s). Instance "mondev", status READY, has 1 handler(s) for this service... The command completed successfully
listener.ora 內容:
LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle
偵聽器按預期工作。它被配置為在 localhost (127.0.0.1) 上偵聽,因此它不能接受來自另一台主機的連接。
我假設偵聽器在 IP 為 192.168.1.130 的主機上執行。所以在監聽器配置文件中更改
localhost
並192.168.1.130
重新啟動監聽器。聽眾 = (DESCRIPTION_LIST = (描述= (地址 =(協議 = IPC)(密鑰 = EXTPROC1521)) (地址 =(協議 = TCP)(主機 = 192.168.1.130)(埠 = 1521)) ) ) ADR_BASE_LISTENER = /u01/app/oracle