大量"library cache lock"事件導致資料庫無法連線

Jujay發表於2011-09-29
問題出現:

27日下午,客戶抱怨無法連上Oracle資料庫O02ESG1(版本11.2.0.2),錯誤如下:
ERROR:
ORA-00018: maximum number of sessions exceeded
此時即使用sysdba也無法登陸資料庫,估計session數已經到達上限了。為了能讓sysdba能登陸資料庫,我在作業系統層面kill掉一些使用者程式。
登陸到資料庫之後,在v$session中查詢結果到類似下面的大量session:

       SID USERNAME                       EVENT                                 PROGRAM          BLOCKING_SESSION
---------- ------------------------------ ---------------------------------------- -----------------------------------------------------------
      1002 OPGCEP1                        library cache lock                       JDBC Thin Client                576  
      1003 OPGCEP1                        library cache lock                       JDBC Thin Client                576
      1004 OPGCEP1                        library cache lock                       JDBC Thin Client                576
      1005                                            SQL*Net message from client  JDBC Thin Client                576
      1006                                             library cache lock                       JDBC Thin Client                576
和客戶溝通了一下,得出以下幾個資訊:
1. OPGCEP1正是應用程式連線資料庫的使用者名稱;
2. 應用程式採用多執行緒的JDBC連線資料庫,且當前連線時的密碼是錯誤的。

問題解決:

Oracle認為這是個Bug:
LIBRARY CACHE LOCKS DUE TO INVALID LOGIN ATTEMPTS (Doc ID 1309738.1)
Bug 12990384: HIGH LIBRARY CACHE LOCK IN 11.2.0.2.0
並給出瞭解決方法:
Dear Customer,

There was new SLEEP () code introduced which will get activated after Failed Login Attempts exceeds 3 and not the threshold setting set for the FAILED_LOGIN_ATTEMPTS parameter value.

Please set the below event in your init.ora file and restart the database.

EVENT="28401 TRACE NAME CONTEXT FOREVER, LEVEL 1"

After setting the above event, you will not be observing the "Library Cache Lock" issue during login with wrong password.

This event was introduced from 11gR2 release onwards to allow customer to turn off the "sleep" after three failed logon attempts, by adding the event to their instance initialization file.

Best Regards,
Tracy Li (李秀文)
Oracle Global Software Support
根據Oracle給出的解決方法,我在引數檔案中加入一行EVENT="28401 TRACE NAME CONTEXT FOREVER, LEVEL 1",重啟資料庫後,問題解決。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26277071/viewspace-708516/,如需轉載,請註明出處,否則將追究法律責任。

相關文章