淘先锋技术网

首页 1 2 3 4 5 6 7

上周周末电脑借给同事用,拿回来发现oracle监听程序打不开了。

可能是因为使用杀毒软件清理电脑造成的。

报错:本地计算机上的oracleoradb11g_home1tnslistener 服务器后停止。某些服务在未由其他服务或者程序使用时将自动停止。

如下图所示:



搞了一晚上终于搞定。总结起来需要三步:

(1)、E:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN 下面的两个文件:listener.ora和tnsnames.ora文件中的host是否配置有问题。

因为这里没有动过,所以配置没问题。

listener.ora:

# listener.ora Network Configuration File: E:\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 = E:\app\Administrator\product\11.2.0\dbhome_1)
      (PROGRAM = extproc)
      (ENVS = "EXTPROC_DLLS=ONLY:E:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    )
  )

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

ADR_BASE_LISTENER = E:\app\Administrator

tnsnames.ora:

# tnsnames.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

SIDY =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = sidy)
    )
  )

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

SIDY1 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = sidy)
    )
  )

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


(2)、检查注册表

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\OracleOraDb11g_home1TNSListener
中的ImagePath改为:
D:\oracle_11g\product\11.1.0\db_1\BIN\TNSLSNR.EXE(之前后面的.EXE没有)

发现以前少了最后面的.EXE,可能是杀毒软件清理掉的。


(3)、检查环境变量:

我的电脑->属性->高级系统设置->高级->环境变量。

发现环境变量的ORACLE_HOME没了。新建ORACLE_HOME=E:\app\Administrator\product\11.2.0\dbhome_1;

重启启动监听进程就没问题了。

所以以后还是尽量少用杀毒软件去清理计算机,否则会带来很大麻烦。系统对大家有帮助。