Friday, August 26, 2011

Error : timeout occurred while waiting to lock object

I am getting error timeout occurred while waiting to lock object when i Compile a package. I want to remove the lock.
SELECT * FROM v$access  where object='package_name'
Take that SID and pass it to the below query and take sid and serial#
SELECT s.inst_id,
       s.sid,
       s.serial#,
       p.spid,
       s.username,
       s.program
FROM   gv$session s
       JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE  s.type != 'BACKGROUND' and
s.sid=?
Kill Session
Use the below  query to kill the corresponding session
ALTER SYSTEM KILL SESSION 'sid,serial#'

No comments: