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應用再次訪問數據庫時,由於連接池的相關會話被清理掉了,從而報錯。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM