应用服务器:Windows Server 2008 R2 Enterprise
故障现象:项目侧同事反映应用服务器上的程序连接数据库报错:ORA-12560: TNS: 协议适配器错误

1.故障重现

在应用服务器上使用sqlplus和PL/SQL工具登录
连接数据库服务器均报错:

ORA-12154: TNS: 无法解析指定的连接标识符

2.定位问题

2.1 ping测试网络

ping 数据库IP地址 网络通畅

C:\Users\Administrator>ping 192.168.1.100

正在 Ping 192.168.1.100 具有 32 字节的数据:
来自 192.168.1.100 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.100 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.100 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.100 的回复: 字节=32 时间<1ms TTL=64 192.168.1.100 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 0ms,平均 = 0ms

2.2 tnsping测试端口

tnsping 数据库IP地址,报错:TNS-12560:TNS:协议适配器错误

C:\Users\Administrator>tnsping 192.168.1.100

TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 27-1月 -
2016 09:55:56 Copyright (c) 1997, 2010, Oracle. All rights reserved. 已使用的参数文件:
D:\app\administrator\product\11.2.0\client_1\network\admin\sqlnet.ora 已使用 EZCONNECT 适配器来解析别名
尝试连接 (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST
=192.168.1.100)(PORT=1521)))
TNS-12560: TNS: 协议适配器错误

2.3 登录数据库主机

SecureCRT工具登录数据库主机服务器报错:

An operation on a socket could not be performed because the system lacked
sufficient buffer space or because a queue was full.

2.4 尝试其他机器连接

发现其他机器是可以登录到数据库服务器的,进一步查看数据库相关信息,也发现一切正常:

  • 数据库服务正常
  • 数据库监听正常
  • 防火墙/SELINUX均未启用
  • 其他与应用服务器同一网段的主机测试到数据库的连接也正常

看起来非常诡异,不过到现在也确定了不是数据库服务器那边的原因,不是网络的原因。

3.解决问题

3.1 两个ORA错误的官方解释

ORA-12560

$ oerr ora 12560
12560, 00000, "TNS:protocol adapter error"
// *Cause: A generic protocol adapter error occurred.
// *Action: Check addresses used for proper protocol specification. Before
// reporting this error, look at the error stack and check for lower level
// transport errors. For further details, turn on tracing and reexecute the
// operation. Turn off tracing when the operation is complete.

ORA-12154

$ oerr ora 12154
12154, 00000, "TNS:could not resolve the connect identifier specified"
// *Cause: A connection to a database or other service was requested using
// a connect identifier, and the connect identifier specified could not
// be resolved into a connect descriptor using one of the naming methods
// configured. For example, if the type of connect identifier used was a
// net service name then the net service name could not be found in a
// naming method repository, or the repository could not be
// located or reached.
// *Action:
// - If you are using local naming (TNSNAMES.ORA file):
// - Make sure that "TNSNAMES" is listed as one of the values of the
// NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA)
// - Verify that a TNSNAMES.ORA file exists and is in the proper
// directory and is accessible.
// - Check that the net service name used as the connect identifier
// exists in the TNSNAMES.ORA file.
// - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
// file. Look for unmatched parentheses or stray characters. Errors
// in a TNSNAMES.ORA file may make it unusable.
// - If you are using directory naming:
// - Verify that "LDAP" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Verify that the LDAP directory server is up and that it is
// accessible.
// - Verify that the net service name or database name used as the
// connect identifier is configured in the directory.
// - Verify that the default context being used is correct by
// specifying a fully qualified net service name or a full LDAP DN
// as the connect identifier
// - If you are using easy connect naming:
// - Verify that "EZCONNECT" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Make sure the host, port and service name specified
// are correct.
// - Try enclosing the connect identifier in quote marks.
//
// See the Oracle Net Services Administrators Guide or the Oracle
// operating system specific guide for more information on naming.

3.2 windows应用服务器信息

使用systeminfo命令查看这台windows应用服务器信息的部分内容:

C:\Users\Administrator>systeminfo
主机名: XXXXWEB1
OS 名称: Microsoft Windows Server 2008 R2 Enterprise
OS 版本: 6.1.7600 暂缺 Build 7600
OS 制造商: Microsoft Corporation
OS 配置: 主域控制器
OS 构件类型: Multiprocessor Free
注册的所有人:
注册的组织:
产品 ID: xxxxx-OEM-xxxxxxx-xxxxx
初始安装日期: 2014/1/26, 21:31:46
系统启动时间: 2014/9/5, 13:42:21
系统制造商: HP
系统型号: ProLiant BL460c Gen8
系统类型: x64-based PC
处理器: 安装了 2 个处理器。
[01]: Intel64 Family 6 Model 45 Stepping 7 GenuineIntel ~2000
Mhz
[02]: Intel64 Family 6 Model 45 Stepping 7 GenuineIntel ~2000
Mhz
BIOS 版本: HP I31, 2013/12/20

可以看到,服务器据上一次启动,已经运行了一年多。
而从上面CRT连接报出的错误信息初步确定是此台windows服务器的socket资源耗尽。
对windows不是很了解,简单粗暴的重启应用服务器后解决了此问题。

记录一则ORA的更多相关文章

  1. 关于Oracle本地连接出现与监听有关的问题的解决方法探讨

    关于Oracle本地连接出现与监听有关的问题的解决方法探讨 监听的作用: 用于应用桌面即用户与数据库服务器建立连接的媒介,客户端发送连接请求,监听识别请求并建立客户端与服务器的连接后,监听的使命并完成 ...

  2. 记录一份Oracle 正确的监听配置文件listener.ora与tnsnames.ora

    一.前言 昨天中午接到领导指示,有其他组的负责人B在厄瓜多尔演示他们组的产品,然后我们组的负责人就想说也在那边搭一套环境,(北美那边的亚马逊云环境),让B帮忙演示下我们的系统. 于是,开始了一个比较曲 ...

  3. Ora中select某时间段记录sql语句

    要查找某时间段的记录,例如查找2013-11-1到2013-11-30的记录. ' group by user_name, user_id 注意:SQL语句中含有sum累加函数,末尾要加group b ...

  4. 在ASP.NET MVC 4 on Mono中使用OracleClient in CentOS 6.x的问题记录

    在ASP.NET MVC 4 on Mono中使用OracleClient in CentOS 6.x的问题记录 前言 最近有个Web项目,业务功能不复杂,但是这个客户(某政府部门)有两个硬性要求:1 ...

  5. 完整记录一则Oracle 11.2.0.4单实例打PSU补丁的过程

    本文记录了打PSU的全过程,意在体会数据库打PSU补丁的整个过程. 1.OPatch替换为最新版本2.数据库软件应用19121551补丁程序3.数据库应用补丁4.验证PSU补丁是否应用成功 1.OPa ...

  6. Oracle的tnsnames.ora配置(PLSQL Developer)

    首先打开tnsnames.ora的存放目录,一般为D:\app\Administrator\product\11.2.0\client_1\network\admin,就看安装具体位置了. 步骤阅读 ...

  7. 再记录一下如何配置oracle instantclient

    这问题遇到很多次,每次重装系统就遇到一次,却总是搞半天才搞定. 今天再次花费几个小时解决,终于有一个清晰的认识必须记录一下. 一.下载解压,不建任何目录,直接复制tnsname.ora过来.(当然也可 ...

  8. oracle10g冷备份和恢复过程记录

    一.冷备份: 1.操作系统无法进入,需要利用启动盘进入winpe系统进行操作. 2.进入PE系统后,搜索所有盘符确认没有其它被作为oracle数据文件存放的目录,也就是说所有oracle有关的文件都存 ...

  9. oracle的sqlnet.ora,tnsnames.ora,listener.ora三个配置文件

    总结: 1 .三个配置文件都是放在$ORACLE_HOME\network\admin目录下. 2 .sqlnet.ora确定解析方式 3 .listener.ora上设SID_NAME,通常用于JD ...

随机推荐

  1. WPF Win32 API 嵌入Form 窗体

    WIn32 API: public class Win32Native { [DllImport("user32.dll", SetLastError = true, CharSe ...

  2. Sass安装与Webstorm File Watcher配置

    一.Sass安装 ruby安装 mac系统默认安装了ruby,可以直接跳过此步骤,linux和windows需要安装ruby环境. windows安装ruby环境: 到ruby官网下载自己系统适用的版 ...

  3. Mac下也能用抓包工具Fiddler

    一直以来都是在Windows底下工作,对于抓包工具,自然而然当属Fiddler最最出色.不过Fiddler是在.Net runtime环境下运行的,所以想要在Mac下使用,有些困难. 在试过了Char ...

  4. php+UEditor粘贴word

    最近公司做项目需要实现一个功能,在网页富文本编辑器中实现粘贴Word图文的功能. 我们在网站中使用的Web编辑器比较多,都是根据用户需求来选择的.目前还没有固定哪一个编辑器 有时候用的是UEditor ...

  5. 等待数据库引擎恢复句柄失败 SqlServer2012安装时报错 Win10

    上周,在一批Win10系统电脑上安装SqlServer 2012时,屡次发生报错,安装失败,显示的失败信息是:等待数据库引擎恢复句柄失败 如下图所示: 面对这样的错误,我的第一反应是百度,在百度上找了 ...

  6. python-Web-django-后台

    url: # member 处理 re_path('member/list/', member.list, name='member/list/'), re_path('member/list_par ...

  7. PJzhang:kali linux安装virtualbox虚拟机和chrome浏览器

    猫宁!!! 参考链接: https://www.cnblogs.com/zhishuai/p/8007410.html kali linux 安装virtualbox. 查询系统的版本 apt-cac ...

  8. SpringCloud学习(五)路由网关(zuul)(Finchley版本)

    在微服务架构中,需要几个基础的服务治理组件,包括服务注册与发现.服务消费.负载均衡.断路器.智能路由.配置管理等,由这几个基础组件相互协作,共同组建了一个简单的微服务系统.一个简单的微服务系统如下图: ...

  9. python 调试技巧

    1.以前都是用print来定位哪里报错,后面发现一个新的调试技巧 import pdb for i in range(nrows): : content = table.row_values(i) p ...

  10. mysql数据库之事务与存储过程

    事务 什么是事务? 事务是指一些SQL语句的集合,这些语句同时执行成功完成某项功能 事务的CAID特性: 原子性:一个事务的执行是整体性的,要么内部所有语句都执行成功,要么一个都别想成功 一致性:事务 ...