zoukankan      html  css  js  c++  java
  • 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应用再次访问数据库时,由于连接池的相关会话被清理掉了,从而报错。

  • 相关阅读:
    sklearn 数据预处理1: StandardScaler
    Gitlab利用Webhook实现Push代码后的Jenkins自动构建
    Shell脚本-自动化部署WEB
    Jenkins可用环境变量以及使用方法
    Docker常用命令
    nginx中root和alias的区别
    gitlab+jenkins=自动化构建
    Spring Boot2.0:使用Docker部署Spring Boot
    Maven内置属性、POM属性
    navicat连接mysql出现Client does not support authentication protocol requested by server解决方案
  • 原文地址:https://www.cnblogs.com/kerrycode/p/10138387.html
Copyright © 2011-2022 走看看