应用服务器: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. Rose的四种视图模型

    用例视图 用例视图中包括了系统中的所有参与者.用例和用例图,必要时还可以在用例视图中添加顺序图.活动图等 逻辑视图 逻辑系统关注系统是如何实现用例中所描述的功能的,主要是对系统功能性需求提供支持,即为 ...

  2. 定位上下文(补充css的position属性)

    ]把元素的position属性设定为relative.absolute或fixed后,继而可以使用TRBL属性,相对于另一个元素移动该元素的位置.这里的“另一个元素”,就是该元素的定位上下文. 绝对定 ...

  3. delphi treeview的子节点图标?

    代码实现不同的子节点图标效果. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, ...

  4. leetcode 股票系列

    五道股票题总结: 121 买卖股票的最佳时机 122 买卖股票的最佳时机 124 买卖股票的最佳时机4 309  最佳股票买卖含冷冻期 714 买卖股票的最佳时机含有手续费 121 买卖股票的最佳时机 ...

  5. 20190903 - CSDN 的奇葩替换

    可能是出于安全原因 CSDN 对内容中的代码,作了很多奇葩的替换. 比如下面两行,是否有差别? # - # -16 有.其实 cut 后的短横线,内部编码不同,前者复制后无法被识别. 再比如下面两个词 ...

  6. ClosureTable

    1. 查询所有子节点 SELECT `chidren_id` FROM `xi_category4_closure` WHERE `parent_id` = 0 AND `distance` > ...

  7. 机器学习笔记——模型调参利器 GridSearchCV(网格搜索)参数的说明

    GridSearchCV,它存在的意义就是自动调参,只要把参数输进去,就能给出最优化的结果和参数.但是这个方法适合于小数据集,一旦数据的量级上去了,很难得出结果.这个时候就是需要动脑筋了.数据量比较大 ...

  8. BasePage基础页面的封装

    Paget Object设计模式,不多说,但在接触了poium测试库后,个人感觉BasePage都是多余的..但在次还是做个记录 class Page(): def __init__(self, dr ...

  9. 【ARM-Linux开发】Linux环境下使用eclipse开发C++动态链接库程序

    Linux环境下使用eclipse开发C++动态链接库程序 Linux中也有类似windows中DLL的变成方法,只不过名称不同而已.在Linux中,动态链接叫做Standard Object,生成的 ...

  10. day33 网络编程之UDP与进程了解

    UDP 什么是UDP协议 在上节课的练习中,使用TCP进行网络编程时,我们会遇到粘包问题,这是因为TCP是流式协议,而今天学习的UDP协议不是流式协议,其发送的数据是数据报格式的,在进行数据发送时该协 ...