码迷,mamicode.com
首页 > 数据库 > 详细

Windows环境下修改Oracle实例监听IP地址

时间:2018-08-11 14:36:21      阅读:177      评论:0      收藏:0      [点我收藏+]

标签:ref   inf   listen   script   strong   nec   tool   lin   cti   

Windows环境下修改Oracle实例监听IP地址。

 

配置文件路径:<ORACLE_HOME>\NETWORK\ADMIN

如:C:\Oracle11gR2\product\11.2.0\dbhome_1\NETWORK\ADMIN

 

一、修改配置文件:listener.ora

# listener.ora Network Configuration File: D:\Oracle11gR2\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = CLRExtProc)
      (ORACLE_HOME = D:\Oracle11gR2\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\Oracle11gR2\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
    (SID_DESC =
      (SID_NAME = orcl)
      (ORACLE_HOME = D:\Oracle11gR2\product\11.2.0\dbhome_1)
    )
  )

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

ADR_BASE_LISTENER = D:\Oracle11gR2

修改listener.ora配置文件中LISTENER节点中host的地址由localhost为IP地址。

另外,一定要在SID_LIST节点中添加一个SID_DESC节点说明。否则会在启动服务时会报如下错误提示。

技术分享图片

 

二、修改配置文件:tnsnames.ora

修改tnsnames.ora配置文件中的地址为IP地址:

# tnsnames.ora Network Configuration File: D:\Oracle11gR2\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

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


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

 

通过以上的配置后,重启Oracle监听及实例服务后即可在其他计算机中通过IP地址连接。

Windows环境下修改Oracle实例监听IP地址

标签:ref   inf   listen   script   strong   nec   tool   lin   cti   

原文地址:https://www.cnblogs.com/xusweeter/p/9459578.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!