List the SQL statement of the table of the ORALCLE database deadlock

zhaozj2021-02-16  94

List the SQL statement of the ORALCLE database deadlock:

============================================= SELECT A.USERNAME, A.SID, A.SERIAL # , B.ID1, C. SQL_TextFrom V $ Session A, V $ LOCK B, V $ SQLText Cwhere EXISTS (SELECT 1FROM V $ SESSION D, V $ LOCK Ewhere D.LockWait = E.kaddr and E.ID1 = B.ID1 ) and A.SID = B.Sidand c.hash_value = a.sql_hash_valueand b.Request = 0; ============================ ========== Select sys.v_ $ session.OSuser, sys.v_ $ session.machine, V $ lock.sid, sys.v_ $ session.serial #, decode (V $ loc.Type, 'Mr', 'Media Recovery', 'RT', 'Redo Thread', 'Un', 'User Name', 'TX', 'Transaction', 'TM', 'DML', 'UL', 'PL / SQL User Lock ',' DX ',' Distributed XAction ',' CF ',' Control File ',' IS ',' Instance State ',' FS ',' File Set ',' IR ',' INSTANCE Recovery ', 'St', 'Disk Space Transaction', 'TS', 'Temp Segment', 'IV', 'Library Cache Invalida-Tion', 'Ls', 'Log Start Or Switch', 'RW', 'Row Wait' , 'SQ', 'Sequence Number', 'TE', 'Extend Table', 'TT', 'TEMP TABLE', 'UNKNOWN'

) LockType, RTRIM (Object_type) || '' || rn (oowner) || '.' || Object_name as object_name, decode (lmode, 0, 'none, 1,' null ', 2,' row-s ', 3,' Row-x ', 4,' Share ', 5,' S / ROW-X ', 6,' Exclusive ',' UNKNOWN ') LOCKMODE, DECODE (Request, 0,' NONE ', 1, 'NULL', 2, 'ROW-S', 3, 'ROW-X', 4, 'Share', 5, 'S / Row-x', 6, 'Exclusive', 'Unknown') RequestMode, CTIME, Block B from V $ LOCK, ALL_OBJECTS, SYS.V_ $ session where v $ lock.sid> 6 and sys.v_ $ session.sid = V $ lock.sid and v $ lock.id1 = all_Objects.Object_id; === ==================================================================================================================================================================================== # :

Select * from v $ locked_Object where object_id = (Select Object_id from DBA_ObjectSwhere Object_Name = 'Table_name')

转载请注明原文地址:https://www.9cbs.com/read-11801.html

New Post(0)