问题描述,现在有两台电脑 A 和 B :
1)电脑 A 上有 Oracle11G服务端; ip地址 192.168.1.198; 端口1521;
2)电脑 A 本机连接数据库正常,可以登录及操作等;
3)电脑B配置访问电脑A时报错:ORA-12541:TNS:无监听程序
报这种错的话,网上有说法,说是防火墙没关,或者是服务端服务没启好等,按本人的实际情况解说:因为oracle服务端访问配置是需要配置访问地址监听的,具体见Oracle安装路径:% product11.2.0dbhome_1NETWORKADMINlistener.ora,这个是我的oracle监听服务的配置文件,内容如下:
# listener.ora Network Configuration File: E:appAdministratorproduct11.2.0dbhome_1 etworkadminlistener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = E:appAdministratorproduct11.2.0dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:E:appAdministratorproduct11.2.0dbhome_1inoraclr11.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.190)(PORT = 1521)) ) ) ADR_BASE_LISTENER = E:appAdministrator
这时候我可以采用两种方法来解决:
方法一:直接用下面的语句覆盖掉listener.ora中的内容,之后重启oracle和监听器即可。
# listener.ora Network Configuration File: E:appAdministratorproduct11.2.0dbhome_1 etworkadminlistener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = CLRExtProc) (ORACLE_HOME = E:appAdministratorproduct11.2.0dbhome_1) (PROGRAM = extproc) (ENVS = "EXTPROC_DLLS=ONLY:E:appAdministratorproduct11.2.0dbhome_1inoraclr11.dll") ) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = SKY-20130705VGC)(PORT = 1521)) ) ) ADR_BASE_LISTENER = E:appAdministrator
方法二:用windows下的oracle的监听配置工具,把监听重新配置一次,之后重启oracle和监听器即可。重新配置监听器的方法如下:
参考资料:
http://www.dedecms.com/knowledge/data-base/oracle/2012/1214/17634.html
http://blog.csdn.net/wwbmyos/article/details/11475551