应用服务器: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均未启用
- 其他与应用服务器同一网段的主机测试到数据库的连接也正常 看起来非常诡异,不过到现在也确定了不是数据库服务器那边的原因,不是网络的原因。
<h1 id="3">3.解决问题</h1>
## 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-12154,ORA-12560解决过程的更多相关文章

  1. oracle错误(ORA:12154 ORA:01034 和 ORA:27101 ORA-18008 ORA-01081)

    按照正常操作流程,启动项目,发现项目报错,原因是连接不上oracle数据库, PLSQL连接时报错,错误码  ORA:12154 无法解析指定的连接标识符 第一次,遇到这个错误,在网上找了资料都是需要 ...

  2. 记录linux /bin被误删除的解决过程

    1.事因: 执行shell测试时,shell中rm -rf $path/* 变量$path为空,结果执行的命令是rm -rf / 事发时及时ctrl+c中断,导致只有/bin /boot目录删除 2. ...

  3. Oracle ORA 12541 报错解决过程

    Oracle 导入全库之后使用plsql登陆时报错 版本12C版本2 ORA-12541: TNS: No Listener 再oracle主机本地可以使用sqlplus 登陆,但是使用plsql无法 ...

  4. PLSQL登录数据库 报ORA -12154的诡异问题

    https://q.cnblogs.com/q/89420/ 现象: 1.机器上先后安装了oracle两个版本的client.在装第一个client后,plsql可以顺利连接数据库a并登录. 2.安装 ...

  5. IIS发布网站 报错500.19 错误解决过程记录

    首先先报上我的环境 WindowsServer 2012 IIS 8.5 网站是FrameWork 4.0 发布网站后浏览,报错信息如下: 解决过程记录如下: 1.看到这个问题首先想到的是权限问题,设 ...

  6. 记录今天客户的SQLSERVER启动不起来( 错误9003)的解决过程2013-11-26

    记录今天客户的SQLSERVER启动不起来( 错误9003)的解决过程2013-11-26 今天一大早上班就接到客户的电话,说:SQLSERVER启动不起来,业务系统使用不了 于是我就使用QQ远程,帮 ...

  7. [转]线上GC故障解决过程记录

    排查了三四个小时,终于解决了这个GC问题,记录解决过程于此,希望对大家有所帮助.本文假定读者已具备基本的GC常识和JVM调优知识,关于JVM调优工具使用可以查看我在同一分类下的另一篇文章: http: ...

  8. 一次线上GC故障解决过程记录

    排查了三四个小时,终于解决了这个GC问题,记录解决过程于此,希望对大家有所帮助.本文假定读者已具备基本的GC常识和JVM调优知识,关于JVM调优工具使用可以查看我在同一分类下的另一篇文章: http: ...

  9. linux服务器报No space left on device错误的解决过程记录

    起因 今天在本地提交了点代码,但到服务器上git pull的时候提示No space left on device,第一反应是猜想可能硬盘满了(很有可能是log导致的),不过想想又觉得不太可能,这台服 ...

随机推荐

  1. java发送邮件..转

    使用Java应用程序发送E-mail十分简单,但是首先你应该在你的机器上安装JavaMail API 和Java Activation Framework (JAF) . 你可以在 JavaMail ...

  2. python之路 - 爬虫

    网络爬虫(又被称为网页蜘蛛,网络机器人,在FOAF社区中间,更经常的称为网页追逐者),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本.另外一些不常使用的名字还有蚂蚁.自动索引.模拟程序或者蠕 ...

  3. apache rewrite_mod 经典疑问解答

    1.RewriteRule ^(com\/.*)$ index.php?do=$1 问:上面的规则匹配表达式 "^(.*)$" 匹配的内容是什么 答:匹配内容是URI站点目录:/d ...

  4. C# WinForm 导出导入Excel/Doc 完整实例教程[使用Aspose.Cells.dll]

    [csharp] view plain copy 1.添加引用: Aspose.Cells.dll(我们就叫工具包吧,可以从网上下载.关于它的操作我在“Aspose.Cells操作说明 中文版 下载 ...

  5. .NET Fringe 定义未来

    在dotnetconf 2015会宣布了4.12-14 在波特兰召开 .NET Fringe http://dotnetfringe.org/ ,中文社区很少有相关的介绍,本文向大家介绍下这个.NET ...

  6. 不要对外公开泛型List成员

    最近在阅读Framework Design Guidelines,本着现学现用的原则,于是就用FxCop工具对代码进行规范性检查时,发现了很多问题,其中包括命名以及一些设计上的规范. 其中,Do no ...

  7. Hibernate 延迟加载原理

        如何简单的理解延迟加载?开发中常见的org.hibernate.LazyInitializationException no session错误又是怎么产生的?下面通过一个简单的例子来解析一下 ...

  8. Windows Azure Storage (18) 使用HTML5 Portal的Azure CDN服务

    <Windows Azure Platform 系列文章目录> Update:2015-04-15 如果读者使用的是国内由世纪互联运维的Azure China服务,请参考笔者的文档:Azu ...

  9. 控制Linux下 mono 服务的启动停止

    当Window下的服务部署到Linux的时候,我们一般用Mono.service 来启动停止.参数比较多,不太好用.于是有个这个Shell脚本. 用法:moa s1 start #启动         ...

  10. Module Zero之语言管理

    返回<Module Zero学习目录> 概览介绍 如何开启 管理语言 管理本地化文本 概览介绍 ABP定义了一个健壮的UI本地化系统,它可用于服务端和客户端.它允许在不同的资源中(Reso ...