ORA-12537: Network Session: End of file

栏目: 数据库 · 发布时间: 7年前

内容简介:[oracle@DB-Server ~]$ oerr ora 1253712537, 00000, "TNS:connection closed"

最近开发组同事使用 AzureFunction App 访问公司内部的 Oracle 数据库时,偶尔会遇到 ORA-12537: Network Session: End of file” 这个错误。关于 ORA-12537 的详细信息如下:

[oracle@DB-Server ~]$ oerr ora 12537

12537, 00000, "TNS:connection closed"

// *Cause: "End of file" condition has been reached; partner has disconnected.

// *Action: None needed; this is an information message.

按照官方文档,引起 ORA-12537 的错误原因很多,如下所示:

ORA-12537 is an informational message and means that the connection has been closed. This error message can happen due to any of the following reasons:

  1. There are too many connections being open by the application.
  2. There are configuration issues in the sqlnet.ora, protocol.ora and listener.ora files.
  3. Database is shut down (maybe for nightly backup), but connection to database was kept by client.
  4. A timeout occurred on the client connection.
  5. A firewall closed idle connections.
  6. There is a path name that is too long for the Oracle TNS client on Windows. See Note:263489.1

一一分析、排除后,怀疑我设定的一个定期清理超过 90 分钟空闲会话的作业导致了这个问题,具体参考 ORACLE 定期清理 INACTIVE 会话 ,测试了一下,我们通过 V$SESSION 找到对应的会话,然后使用下面 SQL 终止会话。

    SQL> ALTER SYSTEM DISCONNECT SESSION 'xxx,xxx' IMMEDIATE;

    

Azure Function App 测试验证发现报 ORA-12537: Network Session: End of file 。注意 ALTER SYSTEM KILL SESSION 'xxx,xxx' IMMEDIATE; 也是同样的错误。

但是如果你使用 SQL*Plus 等工具(使用 SQL*Net 连接数据库),测试发现报 ORA-03113 :通信通道的文件结尾

ORA-12537: Network Session: End of file

查了一下官方文档关于 AzureFunction 连接数据库的相关知识,因为连接池缘故,数据库的会话一直处于 INACTIVE 状态,而当达到条件时(空闲超过 90 分钟),就被作业清理掉,而当后面应用访问时,由于连接池的相关会话被清理掉,从而报错。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

程序员的自我修养

程序员的自我修养

俞甲子、石凡、潘爱民 / 电子工业出版社 / 2009-4 / 65.00

这本书主要介绍系统软件的运行机制和原理,涉及在Windows和Linux两个系统平台上,一个应用程序在编译、链接和运行时刻所发生的各种事项,包括:代码指令是如何保存的,库文件如何与应用程序代码静态链接,应用程序如何被装载到内存中并开始运行,动态链接如何实现,C/C++运行库的工作原理,以及操作系统提供的系统服务是如何被调用的。每个技术专题都配备了大量图、表和代码实例,力求将复杂的机制以简洁的形式表......一起来看看 《程序员的自我修养》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具