内容简介:[oracle@DB-Server ~]$ oerr ora 1253712537, 00000, "TNS:connection closed"
最近开发组同事使用 Azure 的 Function 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:
- There are too many connections being open by the application.
- There are configuration issues in the sqlnet.ora, protocol.ora and listener.ora files.
- Database is shut down (maybe for nightly backup), but connection to database was kept by client.
- A timeout occurred on the client connection.
- A firewall closed idle connections.
- 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 :通信通道的文件结尾 ”
查了一下官方文档关于 Azure 的 Function 连接数据库的相关知识,因为连接池缘故,数据库的会话一直处于 INACTIVE 状态,而当达到条件时(空闲超过 90 分钟),就被作业清理掉,而当后面应用访问时,由于连接池的相关会话被清理掉,从而报错。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。