Today, I encountered an execution statement that has not been executed for a long time: delete table XXX where ......, but there is no problem when selecting. It was later discovered that the
There is no commit when select * from XXX for update, and Oracle locks the record.
It can be solved by:
Query lock records first
Sql code
SELECT s.sid, s.serial# FROM v$locked_object lo, dba_objects ao, v$session s WHERE ao.object_id = lo.object_id AND lo.session_id = s.sid;
then delete the lock record
Sql code
ALTER system KILL session 'SID,serial#';
Through the above sql, the problem is finally solved!