2012-05-22 35 views
1

我目前正在面向我的java服務器應用程序中的ORA-27101。當它啓動時,它在一段時間內工作正常,然後出現失敗並且應用程序丟失。我只能在我的日誌中看到這些ORA。數據庫可能會停機一兩個小時。但是在那段時間之後,應用程序再也沒有回來過。重新啓動後,一切都很好。使用通用連接池的ORA-27101

所以我的問題是: 什麼導致應用程序的這種行爲? 當我的應用程序中出現此異常時,我必須做什麼?重啓是唯一的方法還是我可以在應用程序內處理這個問題?

操作系統是Windows Server 2008,Oracle數據庫是11g。我正在使用oracle jdbc驅動程序和通用連接池來管理多個連接。

最後的堆棧跟蹤:

java.sql.SQLException: Exception while getting connection: oracle.ucp.UniversalConnectionPoolException: cannot get connection from datasource: java.sql.SQLRecoverableException: ORA-01034: ORACLE not available 
ORA-27101: shared memory realm does not exist 
      at oracle.ucp.util.UCPErrorHandler.newSQLException(UCPErrorHandler.java:488) 
      at oracle.ucp.util.UCPErrorHandler.throwSQLException(UCPErrorHandler.java:163) 
      at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:928) 
      at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:863) 
      at oracle.ucp.jdbc.PoolDataSourceImpl.getConnection(PoolDataSourceImpl.java:855) 

回答

1

此錯誤意味着您的數據庫已關閉。

ORA-01034: ORACLE not available Cause: Oracle was not started up. Possible causes include the following: - The SGA requires more space than was allocated for it.

  • The operating-system variable pointing to the instance is improperly defined.

Action: Refer to accompanying messages for possible causes and correct the problem mentioned in the other messages. If Oracle has been initialized, then on some operating systems, verify that Oracle was linked correctly. See the platform specific Oracle documentation.

有此錯誤的原因多:

  1. 服務器崩潰
  2. 一些數據庫操作導致的不穩定狀態數據庫。
  3. 沒有足夠的空間
+0

謝謝。你有沒有得到一些建議如何處理在ucp應用程序中的這個錯誤。 – sebastian

+0

由於數據庫本身已關閉,因此您必須重新啓動數據庫才行,但同時查看數據庫日誌以提取與確切原因相關的信息 – mprabhat

+0

數據庫再次可用,但應用程序(連接池)沒有識別它。重新啓動應用程序後,它工作。 – sebastian