【oracle】【解决方案】ORA-12514:TNS: 监听程序当前无法识别连接描述符中请求的服务 ORA-12541:TNS:无监听程序的错误

2023-12-20 12:45:54

今天重新启动服务器后,tomcat启动异常,测试oracle后报错,提示ora-12541:tns:无监听程序

关掉监听服务

打开目录:D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN

修改前配置文件:

# 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))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\app\Administrator

修改HOST = localhost为HOST = ecs-dbcc(计算机名)

修改后配置文件:

# 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 = TCP)(HOST = ecs-dbcc)(PORT = 1521))
    )
  )

ADR_BASE_LISTENER = D:\app\Administrator

启动监听服务器,测试连接,显示:ORA-12514:TNS: 监听程序当前无法识别连接描述符中请求的服务

使用Net Manager再测试:连接测试成功。

文章来源:https://blog.csdn.net/ok060/article/details/135104178
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。