1、问题现象
项目反馈出现整体卡顿问题,经确认与物化视图导致的数据库阻塞有关,阻塞源会话状态为active,等待类型为enq: JI - contention。
2、问题分析
enq: JI - contention等待原因: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。即出现等待的原因可能与物化视图刷新或视图修改有关。
查询物化视图定义,发现设置了 REFRESH FAST ON COMMIT,即刷新频率过高导致。
3、相关查询脚本
--物化视图查询 SELECT * FROM USER_MVIEWS; SELECT * FROM ALL_MVIEWS; --物化视图定义查询 SELECT MVIEW_NAME, QUERY, REFRESH_MODE, REFRESH_INTERVAL FROM USER_MVIEWS WHERE MVIEW_NAME = '你的物化视图名称';标签:阻塞,REFRESH,物化,视图,MVIEWS,Oracle,SELECT From: https://www.cnblogs.com/wang-xiaohui/p/18560141