Home » SQL & PL/SQL » SQL & PL/SQL » ORA-04021 Timeout occured while waiting to lock object (Oracle 10g)
ORA-04021 Timeout occured while waiting to lock object [message #434467] Wed, 09 December 2009 06:03 Go to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello,

I have a package which I modified and was trying to recompile but whenever I try recompilation, I get Oracle error ORA-04021. A timeout occurs while waiting to lock package for recompilation. Attempting to drop the package then recreate it also behaves the same way. My package has only 2 particularities (and they might not be blamed for this situation anyway) :

1] It uses CLOB variables (fiel read into CLOB variable)

2] It dynamically disables and enables constraints on other user tables.

I have also tried flushing Shared Pool but to no avail.

thanks for your lights,
Didier
Re: ORA-04021 Timeout occured while waiting to lock object [message #434475 is a reply to message #434467] Wed, 09 December 2009 06:17 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
You explained what seems important to you but maybe the important part is somewhere in what you didn't explain (as you don't know where the error comes from you can't say it is wrong), so post the whole stuff then we can estimate the problem by ourselves.

Regards
Michel
Re: ORA-04021 Timeout occured while waiting to lock object [message #434476 is a reply to message #434467] Wed, 09 December 2009 06:18 Go to previous messageGo to next message
cookiemonster
Messages: 13963
Registered: September 2008
Location: Rainy Manchester
Senior Member
presumably someone else is trying to run the package at the same time. And I wouldn't ever try flushing the shared pool.
Re: ORA-04021 Timeout occured while waiting to lock object [message #434598 is a reply to message #434476] Wed, 09 December 2009 21:48 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello and thanks guys.

Now one thing I would like to point out is that the database I'm using is found on a Dev server and actually when I was attempting to recompile the package, I was the only one connected (I started that DB myself only for testing purposes Wink ) Moreover, for professional ethics, I'm not allowed to post source code even for debugging purposes, sorry for that.

regards,
Didier


Re: ORA-04021 Timeout occured while waiting to lock object [message #434601 is a reply to message #434598] Wed, 09 December 2009 22:13 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Were you using SQL Navigator?
Re: ORA-04021 Timeout occured while waiting to lock object [message #434603 is a reply to message #434467] Wed, 09 December 2009 22:28 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hi,

I just relaunched recompilation this morning and it worked out fine. I don't want to dig into the subject anymore and I want to thank you for your posts.

best regards,
Didier
Re: ORA-04021 Timeout occured while waiting to lock object [message #434633 is a reply to message #434603] Thu, 10 December 2009 01:00 Go to previous messageGo to next message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Too bad you don't want to dig anymore as it could be useful for you and others that can reach the same case (maybe you in a near futur if you didn't actually solve the problem it is likely it will happen soon).

Regards
Michel
Re: ORA-04021 Timeout occured while waiting to lock object [message #434808 is a reply to message #434601] Thu, 10 December 2009 21:41 Go to previous messageGo to next message
didiera
Messages: 134
Registered: August 2007
Location: Mauritius
Senior Member
Hello

No I was just trying to recompile it in Toad. Then i copied the modified package body into an .sql file and tried launching it in sqlplus but it behaved the same. The problem it seems was coming from Oracle itself.

regards,
Didier
Re: ORA-04021 Timeout occured while waiting to lock object [message #434824 is a reply to message #434808] Fri, 11 December 2009 01:19 Go to previous message
Michel Cadot
Messages: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
And as we still have no code we can't say anything about the reason (which may be obvious for some of us and impossible to guess for others).

Regards
Michel
Previous Topic: searching through at table
Next Topic: attendence register
Goto Forum:
  


Current Time: Tue Feb 11 20:26:56 CST 2025