Oracle修改监听IP地址---- hostname必须填127.0.0.1的问题----除本机外其它电脑连接不了本机oracle数据服务器

oracle 11g断网安装时,没有检测net的功能,所以安装完后,netstat -an 发现自动监听的是127.0.0.1:1521,这样安装完成后,其他的主机根本无法连接,是什么原因呢?

 

排错后发现,是主机名的问题,操作:

1.在cmd中,输入hostname 发现主机名


2.修改监听文件 listener.ora 文件在 D:\app\Administrator\product\11.2.0\dbhome_1\network\admin 目录下,注释部分的主机名原为Localhost

# listener.ora Network Configuration File: D:\app\Administrator\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:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:D:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )
 
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
      (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN-ASA0GB1AV61原为localhost
) ) ADR_BASE_LISTENER = D:\app\Administrator


3.
把其中的localhost换成自己的主机名
 
再修改主机名文件 tnsnames.ora
# tnsnames.ora Network Configuration File: D:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
 
LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN..原为localhost
 
 
ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )
 
ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = WIN-ASA0GB1AV61)(PORT = 1521))//WIN..原为localhost
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

同样把localhost换成自己的主机名
再用lsnrctl.ora检测,发现监听IP地址变为:192.168.1.251:1521 0.0.0.0 (192.168.1.251为本主机IP)
 
成功!





http://www.cnblogs.com/xing901022/p/3327857.html




你可能感兴趣的:(Oracle修改监听IP地址---- hostname必须填127.0.0.1的问题----除本机外其它电脑连接不了本机oracle数据服务器)