Home » SQL & PL/SQL » SQL & PL/SQL » ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518423] Wed, 03 August 2011 16:24 Go to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
PL/SQL Release 11.1.0.6.0 - Production
"CORE 11.1.0.6.0 Production"

Hi all,

I have a procedure which disables the indexes, load the data, rebuild the indexes. When it reaches the point where it starts rebuilding the indexes, it gives this ORA-54 error. So I have tried adding the following:
  EXECUTE IMMEDIATE 'commit';
  EXECUTE IMMEDIATE 'alter session set ddl_lock_timeout=240' ;

  EXECUTE IMMEDIATE 'ALTER INDEX WCLAIM.WC_FRDCLAIM_COMMODITY_FK REBUILD NOLOGGING';


But with ddl_lock_timeout=300 it sometimes throws the ORA-54 error and sometimes it gives "Internet Explorer cannot display the page error, which I assume is due to time-out.

I have also tried ONLINE option
EXECUTE IMMEDIATE 'ALTER INDEX WCLAIM.WC_FRDCLAIM_COMMODITY_FK REBUILD ONLINE NOLOGGING'

But i got Insufficient privilege error. It needs CREATE TABLE rights directly to the user, and not through the role, which I dont have it.

I am using IE 7, which has time-out limit of 60 mins, according to Microsoft Support page, but my procedure takes max 10 mins, sometimes just 5 minutes.. so why does the IE displays that error. And if I look at the log file, its perfectly ok. So the procedure is doing what its supposed to do in background. But how can we fix the error on IE ?

Thanks
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518425 is a reply to message #518423] Wed, 03 August 2011 16:41 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/

I 100% dislike doing any DDL from within any PL/SQL procedure.


> EXECUTE IMMEDIATE 'alter session set ddl_lock_timeout=240' ;
> EXECUTE IMMEDIATE 'ALTER INDEX WCLAIM.WC_FRDCLAIM_COMMODITY_FK REBUILD NOLOGGING';

I am NOT convinced that same SESSION runs both commands above.
It very well could be that the ALTER SESSION has ZERO impact on the ALTER INDEX statement.
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518441 is a reply to message #518425] Wed, 03 August 2011 23:16 Go to previous messageGo to next message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
In addition "EXECUTE IMMEDIATE 'commit';" is silly; why are you using EXECUTE IMMEDIATE to execute a COMMIT?

Regards
Michel
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518450 is a reply to message #518441] Thu, 04 August 2011 00:09 Go to previous messageGo to next message
Littlefoot
Messages: 21826
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It doesn't look like an Apex question, so I'll move it to a general SQL & PL/SQL forum for now.
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518538 is a reply to message #518425] Thu, 04 August 2011 08:38 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Quote:
> EXECUTE IMMEDIATE 'alter session set ddl_lock_timeout=240' ;
> EXECUTE IMMEDIATE 'ALTER INDEX WCLAIM.WC_FRDCLAIM_COMMODITY_FK REBUILD NOLOGGING';

I am NOT convinced that same SESSION runs both commands above.
It very well could be that the ALTER SESSION has ZERO impact on the ALTER INDEX statement.

So what is the other option to set ddl_lock_timeout, as it has to be done after the data loading is done, and before rebuilding the indexes. I have timeout , because rebuilding indexes was taking a long time, because the table seemed to be locked.

Can i use DBMS_LOCK.sleep, before rebuilding the index? But have read that DBMS_LOCK.sleep is not good if your wait time is more than 10 mins.- is this true ?

Thank you
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518540 is a reply to message #518538] Thu, 04 August 2011 08:42 Go to previous messageGo to next message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
But have read that DBMS_LOCK.sleep is not good if your wait time is more than 10 mins.- is this true ?

Where did you read this?
ALWAYS post a link or a clear reference to what you refer.

Regards
Michel
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518541 is a reply to message #518540] Thu, 04 August 2011 08:46 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
here is the link
Quote:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6019886867656


In the 1st answer,
Quote:
There is an issue with really large sleep times. Suggest you sleep no more then 10
minutes or so
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518542 is a reply to message #518538] Thu, 04 August 2011 08:47 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>So what is the other option to set ddl_lock_timeout,
Realize that we only know what you post.
A possible alternative would be to do all of this from OS level via sqlplus, sqlldr & similar utilities.
Since did NOT follow Posting Guidelines, http://www.orafaq.com/forum/t/88153/0/, we don't know OS name or version.
I have NO idea how or why you bring IE7 into this discussion.
You have a mystery & we have no clues.
Re: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired [message #518543 is a reply to message #518541] Thu, 04 August 2011 08:53 Go to previous message
Michel Cadot
Messages: 68767
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
rkhatiwala wrote on Thu, 04 August 2011 15:46
here is the link
Quote:
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6019886867656


In the 1st answer,
Quote:
There is an issue with really large sleep times. Suggest you sleep no more then 10
minutes or so

You refer to a 10 years old topic about a version that is 7 versions back the current one to make your choice?
Do you know that you are no more using Windows Millenium on your PC?

Regards
Michel

[Updated on: Thu, 04 August 2011 08:53]

Report message to a moderator

Previous Topic: CREATING PARTITION TABLES
Next Topic: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Goto Forum:
  


Current Time: Fri Aug 29 17:42:44 CDT 2025