代码改变世界

断开网线后监听服务器配置

2012-06-30 15:14  潇湘隐者  阅读(1069)  评论(0编辑  收藏  举报

笔记本拔掉网线后,从服务启动ORACLE监听服务器时报错(如下图所示)

clip_image002

通过命令启动查看具体错误信息如下所示:

clip_image004

查看具体的报错日志信息log.xml,如下所示:

代码

 

通过查看出错信息:监听该对象时出错: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=172.20.32.106)(PORT=1521)))。可以知道只需设置监听配置文件listener.ora文件中红色部分即可

 

# listener.ora Network Configuration File: E:\app\kerry\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 = E:\app\kerry\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:E:\app\kerry\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
     (SID_DESC =
      (GLOBAL_DBNAME = orcl.20.32.106)
      (ORACLE_HOME = E:\app\kerry\product\11.2.0\dbhome_1)
      (SID_NAME = ORCL)
    )
  )

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.20.32.106)(PORT = 1521))
    )
  )

 

 

 

改为

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

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

)

)

重启服务即可。当然也可以用127.0.0.1来替换localhost,当然你必须设置C:\Windows\System32\drivers\etc下的hosts文件,此时启动监听服务后。如果你想通过用PL/SQL等客户端工具来连接数据,你还必须修改tnsnames.ora中的配置,把172.20.32.106 IP地址改为localhost或127.0.0.1。

ORCL =

(DESCRIPTION =

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

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = orcl.20.32.106)

)

)

否则会如下报错:

clip_image006

一切设定好了后,所有问题都解决了。