Article From:https://www.cnblogs.com/xiluhua/p/9969880.html

oracle deadlock

--Look up the user name and the client machineSELECT distinct s. username, s. MACHINE, S. sid||','||s.serial#
    FROM gv$session s, gv$lock l, dba_objects o
   WHERE l.sid = s.sid
     AND l.id1 = o.object_id(+)
    
     AND s.username is NOT NULL
      and s.MACHINE = 'WORKGROUP\PC-201301201414'
     
--This SQL allows you to see which users lock which tables in what way and which Session they use.SELECT s. username, S. MACHINE, s. SQL_EXEC_START,DeCode (l.type,'TM', 'TABLE LOCK', 'TX', 'ROW LOCK', NULL) LOCK_LEVEL,
         o.owner,
         o.object_name,
         o.object_type,
         s.sid,
         s.serial#,
         s.sid||','||s.serial#
    FROM gv$session s, gv$lock l, dba_objects o
   WHERE l.sid = s.sid
     AND l.id1 = o.object_id(+)
     AND s.username is NOT NULL
     AND (s.username='' or s.username = 'TPSC_TEST' or s.username = '') --'TPSC'   TPSC_TEST  --It must be capitalized.

 

Link of this Article: Oracle deadlock

Leave a Reply

Your email address will not be published. Required fields are marked *