Thursday, September 13, 2012

ORA-04021: timeout occurred while waiting to lock object

U have to kill all sessions using object which u wanna compile, u can use this below script to find out which sessions are using any object..

select 'kill -9 '||b.spid||' # username '||c.username||'' from gv$access a, gv$process b, gv$session c where a.object=upper('object_name') and a.sid=c.sid and b.addr=c.paddr


run the output on linux to kill all sessions then compile object

No comments:

Post a Comment