Oracle blocking issue with lock table in exclusive mode
A PL/SQL program previously worked in serial, but it hung when running in parallel.
select ses.SID, substr(SQ.SQL_TEXT,0),sq.LAST_LOAD_TIME,
ses.schemaname,
SES.LOCKWAIT,
SES.BLOCKING_SESSION_STATUS,
BLOCKING_SESSION,SES.STATE,
SES.EVENT,
SES.EVENT#,
SES.SECONDS_IN_WAIT
,(select object_name from dba_objects where object_id=ses.ROW_WAIT_OBJ#) object_name
from V$SESSION SES inner join V$SQL SQ on
SES.SQL_ID=SQ.SQL_ID
order by sq.LAST_LOAD_TIME desc
It turned out every session was contending for the same object. Furthermore, the the following query result showed they were requesting exclusive lock but none succeeded.
Request/Lmode = 6 --> exclusive lock
Block = 1 --> Blocker
Block = 0 --> Blockee
SELECT sid, type, id1, id2, lmode, request,block FROM V$LOCK WHERE request > 0 order by sid;
I looked into procedure that upserts that specific objects, and found that before insert it places an exclusive lock explicitly by:
Lock table xxx in exclusive mode.
Yes, that's the reason why the program hung.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/638844/viewspace-772803/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE LOCK MODE 1.2.3.4.5.6Oracle
- cannot mount database in EXCLUSIVE modeDatabase
- oracle deadlock with TM lock in SX/SSX modeOracle
- TM LOCK MODE
- [Oracle] ORA-01102: cannot mount database in EXCLUSIVE modeOracleDatabase
- ORACLE基礎之oracle鎖(oracle lock mode)詳解Oracle
- Oracle ORA-01102故障: cannot mount database in EXCLUSIVE modeOracleDatabase
- innodb_autoinc_lock_mode
- Oracle 11g RAC ORA-01102: cannot mount database in EXCLUSIVE modeOracleDatabase
- ORA-01102: cannot mount database in EXCLUSIVE modeDatabase
- ORA-01102 cannot mount database in EXCLUSIVE modeDatabase
- Oracle 11g 報錯ORA-01102: cannot mount database in EXCLUSIVE modeOracleDatabase
- Oracle LOB issueOracle
- Oracle startup mount exclusive作用Oracle
- oracle ORA-01102: cannot mount database in EXCLUSIVE mode(無法起到獨佔模式)OracleDatabase模式
- 【MySQL】select for update 的Row Lock 與Table LockMySql
- How to Start 11gR2 Grid Infrastrucure in Exclusive Mode (Doc ID 1364971.1)AST
- 關於ORA-01102: cannot mount database in EXCLUSIVE modeDatabase
- Parallel DML和append將在表上產生exclusive lockParallelAPP
- enable table lock 的enqueue等待ENQ
- create table if not exists Waiting for table metadata lockAI
- MySQL 共享鎖 (lock in share mode),排他鎖 (for update)MySql
- RAC 11.2.0.3 ORA-01102: cannot mount database in EXCLUSIVE mode”Database
- Oracle Performance Top Issue listOracleORM
- Waiting for table metadata lockAI
- 深入理解Java併發框架AQS系列(三):獨佔鎖(Exclusive Lock)Java框架AQS
- oracle time modeOracle
- oracle的exclusive和restricted啟動方式OracleREST
- ORA-01102: cannot mount database in EXCLUSIVE mode 的解決辦法Database
- InnoDBd的auto_increment以及innodb_autoinc_lock_modeREM
- master bug InnoDB Error unlock row could not find a 4 mode lockASTError
- Oracle BI Answers Direct Database Request issueOracleDatabase
- 啟動資料庫時 ORA-01102: cannot mount database in EXCLUSIVE mode資料庫Database
- 深入理解SELECT ... LOCK IN SHARE MODE和SELECT ... FOR UPDATE
- MySQL 5.7 SELECT ... LOCK IN SHARE MODE|FOR UPDATE語句說明MySql
- oracle lock鎖_v$lock_轉Oracle
- [Oracle Script] LockOracle
- About Oracle LockOracle