Alex Rivera | Logout

Oracle database is hanging infinitly in UPDATE queries

Asked 2011-09-21T14:43:58.780
13

suddenly my update queries are not executing . i can make select queries but when i try to update records the database hangs infinitly. i tried even from sql plus and nothing happens.

Edit
Report

1 Answer

21

This query will show you who is blocking your update. Execute the update that hangs, then in another session run this:

select s1.username || '@' || s1.machine ||
  ' ( SID=' || s1.sid || ' )  is blocking '
  || s2.username || '@' || s2.machine || ' ( SID=' || s2.sid || ' ) ' AS blocking_status
  from v$lock l1 join v$lock l2 on (l1.id1 = l2.id1 and l2.id2 = l2.id2) 
                 JOIN v$session s1 ON (s1.sid = l1.sid)
                 JOIN v$session s2 ON (s2.sid = l2.sid)
  WHERE l1.BLOCK=1 and l2.request > 0;

EDIT:

To properly attribute this, it looks like I cribbed this a while back from ORAFAQ.

answered 2011-09-21T15:10:10.123

Your Answer