Phenomenon: use sql statement to truncate the table, the prompt information is as follows:
query the locked object:
select session_id from v$locked_object;
Query the process that the database is waiting for the lock:
SELECT sid, serial#, username, osuser FROM v$session where sid = 7482;
Terminate the waiting process:
ALTER SYSTEM KILL SESSION '7482,3842';
Try the previous sql statement again:
Attachment:
Query the lock in the database
select * from v$lock;
Query the process that the database is waiting for the lock
select * from v$session where lockwait is not null;
Query lock wait event
select * from v$session_wait where event='enqueue';