当前位置: 移动技术网 > IT编程>数据库>Oracle > ORA-12537: Network Session: End of file

ORA-12537: Network Session: End of file

2018年12月18日  | 移动技术网IT编程  | 我要评论

藕断丝连简谱,春丽不知火舞被俘记,东坝中学

最近开发组同事使用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:通信通道的文件结尾

 

 

 

 

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

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网