﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals / Oracle Forum / ORA - Oracle Database Error Codes - Search via specific error codes. / ORA-30000 Through ORA-40273   / ORA-04021: timeout occurred while waiting to lock object / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals</description><link>http://www.franklinfaces.com/</link><webMaster>no-reply@FranklinFaces.com</webMaster><lastBuildDate>Fri, 10 Feb 2012 23:26:23 GMT</lastBuildDate><ttl>20</ttl><item><title>ORA-04021: timeout occurred while waiting to lock object</title><link>http://www.franklinfaces.com/Topic134-57-1.aspx</link><description>&lt;FONT color=#3333dd&gt;Hi,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;I was getting the following error while compiling a procedure:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR&gt;&lt;FONT color=#113333&gt; alter procedure ECOM1.MAINRUN compile&lt;BR&gt;*&lt;BR&gt;ERROR at line 1:&lt;BR&gt;ORA-04021: timeout occurred while waiting to lock object ECOM1.MAINRUN&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;I checked the following two queries to see if there were any blockers etc.. and the query came back with no rows and still I was not sure where to go from here.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SQL&amp;gt;  &lt;FONT color=#113333&gt;&lt;STRONG&gt;select * from dba_blockers;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;no rows selected&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#113333&gt;&lt;STRONG&gt;select * from dba_waiters;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;no rows selected&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;So then I ran the compile statement again and then ran this query:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#113333&gt;&lt;STRONG&gt;select p.spid "Thread", s.sid "SID-Top Sessions",&lt;BR&gt;substr(s.osuser,1,15) "OS User", substr(s.program,1,25) "Program Running"&lt;BR&gt;from v$process p, v$session s&lt;BR&gt;where p.addr=s.paddr&lt;BR&gt;order by substr(s.osuser,1,15);&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;Using this query, I found a couple of processes that were running.  I killed them using the OS process id at OS prompt:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#113333&gt;&lt;STRONG&gt;kill -9 &amp;lt;thread from above&amp;gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;That fixed it .&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;SQL&amp;gt; &lt;FONT color=#113333&gt;&lt;STRONG&gt;alter procedure ECOM1.MAINRUN compile;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;Procedure altered.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;P&gt;&lt;FONT color=#3333dd&gt;Thanks,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;BR&gt; </description><pubDate>Tue, 09 Jun 2009 02:06:32 GMT</pubDate><dc:creator>Admin</dc:creator></item></channel></rss>
