TNS:connection closed

<p>
连接数据库时出现TNS:connection closed .</p><p>
</p><p>tnsping,也出现<span style="font-family: monospace; white-space: pre; background-color: rgb(240, 240, 240);">TNS:connection closed.</span></p>
C:\Users\Administrator>tnsping orcl


TNS Ping Utility for 64-bit Windows: Version 11.2.0.2.0 - Production on 01-JUN-2016 00:08:59


Copyright (c) 1997, 2014, Oracle.  All rights reserved.


Used parameter files:
D:\app\Administrator\product\11.2.0\client_1\NETWORK\ADMIN\sqlnet.ora




Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =127.0.0.1)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME =XE)))
TNS-12537: TNS:connection closed

首先怀疑监听器出了问题

在启动监听时,出现了异常

Service "xe" has 1 instance(s).
  Instance "xe", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully


解决方案:

找到监听的ora文件:Listener Parameter File   D:\app\Administrator\product\11.2.0\client_1\NETWORK\ADMIN\listener.ora

核对以下配置内容

SID_LIST_LISTENER =
  (SID_LIST =
     (SID_DESC =
      (GLOBAL_DBNAME = xe)
      (ORACLE_HOME =d:\app\Administrator\product\11.2)
      (SID_NAME = xe) 
    )
  )

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

ADR_BASE_LISTENER = d:\app\Administrator

注:xe为数据库实例名


重启后恢复正常





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值