【MW】Drop Materialized View Hangs with 'Enq: JI - Contention'
事件:當執行DROP MATERIALIZED VIEW 時 會話hang住。
用下面命令生成跟蹤檔案(透過任意會話):
點選(此處)摺疊或開啟
-
sqlplus /nolog
-
connect / as sysdba
-
REM The select below is to avoid problems on some releases
-
select * from dual;
-
oradebug setmypid
-
oradebug unlimit
- oradebug dump systemstate 266
點選(此處)摺疊或開啟
-
WAIT #4: nam='enq: JI - contention' ela= 4961081 name|mode=1246298118 view object #=3893654 0=0 obj#=3012275 tim=30332617495564
- WAIT #4: nam='enq: JI - contention' ela= 2929739 name|mode=1246298118 view object #=3893654 0=0 obj#=3012275 tim=30332620425505
當我們試圖刪除這個物化檢視時由於DBMS_JOB引起了這個等待事件,所以在刪除這個JOB後我們就可以刪除該物化檢視
原因:Due to the JI contention
解決辦法:
1. killled正在執行的job,檢查Check DBMS_JOBS_RUNNING 檢視.
2. 重新整理job並離線,移除job
3. 完成刪除,看不到相關job和物化檢視。
附等待事件介紹:出處: />
Sessions waiting on this event are waiting on locks held during materialized view operations (such as refresh, alter) to prevent concurrent operations on the same materialized view.
Solutions
A materialized view cannot be fast refreshed more than once in a given period because it is serialized during the commit phase. Ensure that only one session at a time is performing the refreshes. If there is more than one session, the first session will work normally but the subsequent sessions will wait on “enq: JI – contention”.
Waits on this event can also be caused by on-commit time logic within the materialized view. Normally when a session updates record 1 and commits and then another session updates record 2 and commits, they do not have to wait for each other. However, when using an on commit-time fast refreshable materialized view on top of the table, we do have to wait when two sessions do totally unrelated transactions concurrently against the same table. This is not a problem when the table is modified infrequently or only by a single session, but it can be a big problem when applied to a table that performs a lot of modifications concurrently. Be sure to use on commit-time fast refreshable materialized views for implementing business rules only on tables that are not concurrently accessed or infrequently changed
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29487349/viewspace-1789477/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- drop materialized view hung !!!ZedView
- enq: US - contentionENQ
- enq: HW - contentionENQ
- enq: TM - contentionENQ
- enq:TM contentionENQ
- enq: DX - contentionENQ
- enq: TS - contentionENQ
- Materialized ViewZedView
- zt_Oracle enq: TX contention 和 enq: TM contention 等待事件OracleENQ事件
- Expert Tips on Drop Temporary Tablespace Hangs!!
- enq:TX - index contentionENQIndex
- enq: TX - index contentionENQIndex
- enq: TX - row lock contentionENQ
- 關於enq: US – contentionENQ
- enq: WF - contention等待事件ENQ事件
- enq: CF - contention 等待事件ENQ事件
- enq: TX - index contention等待ENQIndex
- enq: TS - contention 等待事件ENQ事件
- 等待事件之enq: HW - contention事件ENQ
- enq: SQ - contention" waits in RACENQAI
- 【故障解決】enq: PS - contentionENQ
- enq:TM-contention事件等待ENQ事件
- 消除 enq: DX - contention 等待事件ENQ事件
- materialized view 的總結ZedView
- about materialized view and long(turn)ZedView
- materialized view (物化檢視)ZedView
- Oracle等待事件之enq: TM – contentionOracle事件ENQ
- 等待事件enq: TX - row lock contention事件ENQ
- oracle等待事件之enq: CF – contentionOracle事件ENQ
- 【等待事件】-enq: TX - row lock contention事件ENQ
- Metlink:Performance issues with enq: US - contentionORMENQ
- 利用materialized view同步資料ZedView
- materialized view基礎知識ZedView
- Materialized View Logs (190)ZedView
- enq: TX - index contention基礎理論ENQIndex
- 故障排除 | enq:TX - index contention等待事件ENQIndex事件
- Troubleshooting 'enq: TX - index contention' WaitsENQIndexAI
- 奇異的enq: TX - row lock contentionENQ