应用服务器: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. EclipseADT编写单元测试代码的步骤

    1. 写一个类 extends AndroidTestCase 2. 写一个测试方法    a.必须是public     b.必须抛出异常给操作系统 public void textAdd()thr ...

  2. 11 MySQL之性能优化

    01-优化简介 MySQL数据库优化是多方面的,原则是减少系统瓶颈,减少资源的占用,增加系统的反应速度. 1.通过优化文件系统,提高磁盘I\O的速写速度: 2.通过优化操作系统的调度策略,提高MySQ ...

  3. coursera 视频总是缓冲或者无法观看的解决办法(Windows 和 Linux 系统 环境)

    现在读了一个机器学习方向的博士,虽然这么长时间也没有学明白什么,但是没事的时候也会看看一些书籍和资料,学这个方向的人基本都会看过吴恩达的coursera课程上的机器学习课程,我也是如此,不过交了钱以后 ...

  4. 一首好听的摇滚歌曲(Ever Dream),以及优美的译作

     送上一首好听的摇滚歌曲,以及优美的译作.祝大家新年快乐.happy new year!  [ti:Ever Dream][ar:Nightwish][al:Century Child][by:吖光] ...

  5. CreationPolicy 枚举的值

    根据[CreationPolicy]枚举的值,我们很容易就能看出其代表的意义,[Shared]代表共享部件,即单例,所有的导入都使用一个实例,如果组合引擎中没有该实例,则会创建,一旦有了,就不会再创建 ...

  6. java.lang.reflect.Method.getAnnotation()方法示例

    转: java.lang.reflect.Method.getAnnotation()方法示例 作者: 初生不惑 Java技术QQ群:227270512 / Linux QQ群:479429477   ...

  7. 小D课堂-SpringBoot 2.x微信支付在线教育网站项目实战_1-2.中大型公司里面项目开发流程讲解

    笔记 2.中大型公司里面项目开发流程讲解     简介:讲解一个项目如何从零到上线,经历过怎样的步骤和流程                  1.一个中大型项目的开发流程,从需求调研到项目上线    ...

  8. 解决Ubuntu MySQL服务无法远程登录

    一.10061错误 Ubuntu安装MySQL . sudo apt-get install mysql-server . apt-get isntall mysql-client . sudo ap ...

  9. idea忽略隐藏文件、文件夹的设置操作

    左上角setting 如果要忽略文件夹,则直接填写文件夹名字即可,例如:要忽略target文件夹[建议:尽量不要把target忽略,因为可能编译出问题排查,还需要查看target文件夹中的编译结果] ...

  10. vue自定义过滤器的创建与使用

    原文地址 过滤器:生活中有很多例子,净水器 空气净化器 .过滤器的作用:实现数据的筛选.过滤.格式化. vue1.*版本是有内置的过滤器,但是在vue2.*所有的版本都已经没有自带的过滤器了. 1.过 ...