• oracle11g本地可以访问但局域网无法访问


      问题描述,现在有两台电脑 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
    View Code

      这时候我可以采用两种方法来解决:

      方法一:直接用下面的语句覆盖掉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
    View Code

      方法二:用windows下的oracle的监听配置工具,把监听重新配置一次,之后重启oracle和监听器即可。重新配置监听器的方法如下:

    参考资料:

    http://www.dedecms.com/knowledge/data-base/oracle/2012/1214/17634.html

    http://blog.csdn.net/wwbmyos/article/details/11475551

  • 相关阅读:
    mybatis 对string类型判断比较 group case when then 综合
    利用Apache shiro SimpleHash 加密字符串
    linux下用rpm 安装jdk
    运行java程序的时候出现Exception in thread "main" java.lang.UnsupportedClassVersionError:
    linux如何查看端口被哪个进程占用?
    Linux如何查看JDK的安装路径
    Linux中查看jdk版本
    linux修改/etc/profile权限
    db2,oracle,mysql ,sqlserver限制返回的行数
    什么是T-SQL
  • 原文地址:https://www.cnblogs.com/ningvsban/p/3605520.html
Copyright © 2020-2023  润新知