[ORACLE 11G]ROW CACHE LOCK 等待
資料庫版本11.2.0.1
使用者反映修改密碼後程式明顯變慢:
檢視AWR發現:
Top 5 Timed Foreground Events
Event | Waits | Time(s) | Avg wait (ms) | % DB time | Wait Class |
---|---|---|---|---|---|
row cache lock | 24,378 | 46,231 | 1896 | 87.83 | Concurrency |
DB CPU | 3,302 | 6.27 | |||
enq: TX - row lock contention | 317 | 36 | 115 | 0.07 | Application |
SQL*Net more data to client | 986,587 | 31 | 0 | 0.06 | Network |
direct path read | 14,789 | 19 | 1 | 0.04 | User I/O |
Time Model Statistics
- Total time in database user-calls (DB Time): 52635.9s
- Statistics including the word "background" measure background process time, and so do not contribute to the DB time statistic
- Ordered by % or DB time desc, Statistic name
Statistic Name | Time (s) | % of DB Time |
---|---|---|
connection management call elapsed time | 21,797.09 | 41.41 |
sql execute elapsed time | 21,419.44 | 40.69 |
parse time elapsed | 9,357.75 | 17.78 |
hard parse elapsed time | 9,307.83 | 17.68 |
DB CPU | 3,302.18 | 6.27 |
hard parse (sharing criteria) elapsed time | 391.35 | 0.74 |
failed parse elapsed time | 7.07 | 0.01 |
PL/SQL execution elapsed time | 2.62 | 0.00 |
repeated bind elapsed time | 0.10 | 0.00 |
PL/SQL compilation elapsed time | 0.01 | 0.00 |
sequence load elapsed time | 0.00 | 0.00 |
DB time | 52,635.93 | |
background elapsed time | 47.09 | |
background cpu time | 24.08 |
由以上資訊基本判定是由使用者的登入引起:
進一步驗證:
SQL>
select event,p1 from v$session a where a.username is not null and a.status='ACTIVE';SQL>
EVENT P1
---------------------------------------------------------------- ----------
row cache lock 7
row cache lock 7
row cache lock 7
row cache lock 7
SQL*Net message to client 1650815232
查詢v$rowcache
SQL> select parameter from v$rowcache where cache#=7;
PARAMETER
--------------------------------
dc_users
dc_users
dc_users
以上資訊可確定是由於使用者的登入導致的大量的row cache lock等待
懷疑是11g的delayed failed logins特性引起
查詢使用者的profile 發現 failed_login_attempts 設定為 unlimited
之後修改failed_login_attempts 為10
半小時後使用者使用的使用者被鎖 可以判斷使用者改密碼還有應用繼續使用原來的密碼登入 登入失敗後反覆嘗試所致
failed_login_attempts 特性參考
http://space.itpub.net/?uid-15747463-action-viewspace-itemid-755776
----透過審計功能分析是哪臺機器哪個使用者的頻繁登陸失敗
SQL> select * from
(
select os_username,userhost,terminal,username,count(*) a
from dba_audit_trail
where returncode = 1017 and timestamp>= date '2013-3-11'
group by os_username,userhost,username,terminal
order by 5 desc )
where rownum<10; 2 3 4 5 6 7 8
OS_USERNAME USERHOST TERMINAL USERNAME A
-------------------- -------------------------------------------------- -------------------- -------------------- ------
user WORKGROUP\EKMZ-041 EKMZ-041 BSUSER 13093
Administrator WORKGROUP\LIBO LIBO BSUSER 12012
Administrator MSHOME\FCK-MB071 FCK-MB071 BSUSER 10953
user WORKGROUP\NKMZ-FZ01 NKMZ-FZ01 BSUSER 7822
Administrator ZZYX-MC187 BSUSER 17
user MSHOME\JIANHU-LJ1020 JIANHU-LJ1020 BSUSER 14
Administrator WORKGROUP\YBB-Z003 YBB-Z003 BSUSER 13
Owner WORK\ZYSF ZYSF BSUSERP 12
Administrator WORKGROUP\REG2 REG2 BSUSER 8
9 rows selected.
ROW CACHE LOCK 等待的分析方法分析如下:
1 ROW CACHE LOCK等待事件是一個共享池相關的等待事件。是由於對於字典緩衝的訪問造成的。
P1 – Cache IdP2 – Mode Held
P3 – Mode Requested
Issues by Row Cache Enqueue Type
--引起該問題的原因
For each enqueue type, there are a limited number of operations that require each enqueue. The enqueue type therefore may give an indication as the type of operation that may be causing the issue. As such some common reasons are outlined below:
DC_TABLESPACES
Probably the most likely cause is the allocation of new extents. If extent sizes are set low then the application may constantly be requesting new extents and causing contention. Do you have objects with small extent sizes that are rapidly growing? (You may be able to spot these by looking for objects with large numbers of extents). Check the trace for insert/update activity, check the objects inserted into for number of extents.
DC_SEQUENCES
Check for appropriate caching of sequences for the application requirements.
DC_USERS
Deadlock and resulting “WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!” can occur if a session issues a GRANT to a user, and that user is in the process of logging on to the database.
DC_SEGMENTS
This is likely to be down to segment allocation. Identify what the session holding the enqueue is doing and use errorstacks to diagnose.
DB_ROLLBACK_SEGMENTS
This is due to rollback segment allocation. Just like dc_segments,identify what is holding the enqueue and also generate errorstacks. Remember that on a multi-node system (RAC) the holder may be on another node and so multiple systemstates from each node will be required.
DC_AWR_CONTROL
This enqueue is related to control of the Automatic Workload Repository. As such any operation manipulating the repository may hold this so look for processes blocking these.
Probably the most likely cause is the allocation of new extents. If extent sizes are set low then the application may constantly be requesting new extents and causing contention. Do you have objects with small extent sizes that are rapidly growing? (You may be able to spot these by looking for objects with large numbers of extents). Check the trace for insert/update activity, check the objects inserted into for number of extents.
DC_SEQUENCES
Check for appropriate caching of sequences for the application requirements.
DC_USERS
Deadlock and resulting “WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!” can occur if a session issues a GRANT to a user, and that user is in the process of logging on to the database.
DC_SEGMENTS
This is likely to be down to segment allocation. Identify what the session holding the enqueue is doing and use errorstacks to diagnose.
DB_ROLLBACK_SEGMENTS
This is due to rollback segment allocation. Just like dc_segments,identify what is holding the enqueue and also generate errorstacks. Remember that on a multi-node system (RAC) the holder may be on another node and so multiple systemstates from each node will be required.
DC_AWR_CONTROL
This enqueue is related to control of the Automatic Workload Repository. As such any operation manipulating the repository may hold this so look for processes blocking these.
定位的辦法:
--查詢row cache lock等待
select event,p1 from v$session where event= 'row cache lock' and status='ACTIVE';
--查詢rowcache 名稱
select * from v$rowcache where cache# =p1;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/15747463/viewspace-755774/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 等待事件之Row Cache Lock事件
- 由row cache lock等待事件引起的效能問題事件
- oracle 'row cache objects' 等待事件解釋OracleObject事件
- 當刪除oracle資料庫user時發生row cache lock 等待事件Oracle資料庫事件
- oracle??邏輯DG同步卡住,session等待row cache lock的處理過程OracleSession
- hang了,嚴重的row cache lock 等待事件--就因大sql文字事件SQL
- Oracle 11g 密碼延遲認證與 library cache lock 等待Oracle密碼
- 【TUNE_ORACLE】等待事件之“library cache lock”Oracle事件
- LIBRARY CACHE LOCK 等待事件事件
- 等待事件enq: TX - row lock contention事件ENQ
- 【等待事件】-enq: TX - row lock contention事件ENQ
- hanganalyze解決row cache lock(ZT)
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!AIENQ
- latch:library cache lock等待事件事件
- 11G 修改使用者密碼導致的row cache lock密碼
- 等待事件enq TX row lock contention分析事件ENQ
- 轉)用hanganalyze解決row cache lock
- (轉)用hanganalyze解決row cache lock
- Oracle 11g業務使用者更改密碼後產生大量library cache lock等待Oracle密碼
- enq:Library cache lock/pin等待事件ENQ事件
- enq: TX - row lock contention等待事件處理ENQ事件
- 故障排除:"WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! "AIENQ
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!的分析AIENQ
- 轉貼_用hanganalyze解決row cache lock
- 用hanganalyze解決row cache lock(轉貼)
- 11g密碼錯誤延時造成大量"library cache lock"等待密碼
- WAITEVENT: "row cache lock" Reference Note (文件 ID 34609.1)AI
- 一次WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCKAIENQ
- zt_library cache pin和lock等待分析
- 尋找 library cache lock 等待事件的session事件Session
- 'library cache lock'等待事件的處理方法事件
- 俺也談談 library cache lock 等待事件事件
- Resolving Issues Where 'Row Cache Lock' Waits are OccurringAI
- Metlink:Troubleshooting:WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK!AIENQ
- 一次Row Cache Lock問題處理過程
- 定位Library Cache pin,Library Cache lock等待的解決方法
- Rac 環境中分割槽表建立index hang(row cache lock)Index
- WAITED TOO LONG FOR A ROW CACHE ENQUEUE LOCK! 與 dc_tablespcesAIENQ