连接oracle时localhost可以ip地址不可以

  1. 在本机安装了oracle,使用sqlplus和plsqldev连接的时候,tnsname.ora中host写的是localhost,此时连接oracle都没有任何问题,但是外机连接本机,和tnsname.ora中host写成ip地址(192.168.1.110)是,报错ora-12547,没有监听等

  2. 解决问题,oracle自带管理工具,程序-》oracle-oracle...-》配置和移植工具-》Net Manager中找到本地,LISTENER,添加一个监听服务地址,然后重启oracle监听服务,然后就可以使用localhost和ip地址对oracle进行访问了

  3. LISTENER.ORA文件

    

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    )

    (DESCRIPTION =

      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1521))

    )

  )


TNSNAME.ORA文件

ORCL =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = orcl)

    )

  )


  

ORCLIP =

  (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.110)(PORT = 1521))

    (CONNECT_DATA =

      (SERVER = DEDICATED)

      (SERVICE_NAME = orcl)

    )

  )


本文出自 “Bad-Kbase” 博客,请务必保留此出处http://bad51men.blog.51cto.com/3141086/1660466

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。