set linesize 400 pagesize 999\r col machine for a20\r col sql_id for a20\r col prev_sql_id for a20\r col object_name for a20\r col object_type for a20\r col oracle_username for a15\r SELECT s.inst_id,\r s.sql_id,\r s.prev_sql_id,\r s.sid,\r s.machine,\r o.object_name,\r o.object_type,\r l.oracle_username,\r l.locked_mode,s.LOGON_TIME,s.blocking_session,C.PIECE,c.sql_text\r FROM gv$locked_object l, gv$session s,\r all_objects o,v$sqltext c\r WHERE l.inst_id=s.inst_id \r AND l.session_id = s.sid\r AND l.object_id = o.object_id\r and s.sql_address=c.address(+); \r
INST_ID SQL_ID PREV_SQL_ID SID MACHINE OBJECT_NAME OBJECT_TYPE ORACLE_USERNAME LOCKED_MODE LOGON_TIM BLOCKING_SESSION PIECE SQL_TEXT ---------- -------------------- -------------------- ----- -------------------- -------------------- -------------------- --------------- ----------- --------- ---------------- ---------- ---------------------------------------- 1 0j01k6ds6uq7v 635 snc-sdyd-oraclerac01 T1 TABLE DBMON 3 08-SEP-23 1 0j01k6ds6uq7v g4y6nw3tts7cc 382 snc-sdyd-oraclerac01 T1 TABLE DBMON 3 08-SEP-23 635 0 delete from t1 where rownum=1
上述测试用例:
session 1 delete from t1 where rownum=1;--正常删除 session 2 delete from t1 where rownum=2;--hang住,等待session1释放锁
标签:语句,object,col,--------------------,session,sql,oracle,表锁,id From: https://www.cnblogs.com/hanglinux/p/17688765.html