ORA-12537: Network Session: End of file

最近开发组同事使用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;

    

 

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

 

 

但是如果你使用SQL*Plus等工具(使用SQL*Net连接数据库),测试发现报ORA-03113:通信通道的文件结尾“,而不是ORA-12537这个错误,如下所示:

 

 

clip_image001

 

 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值