<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlueGecko Denmark</title>
	<atom:link href="https://bluegecko.dk/tag/ddl_lock_timeout/feed/" rel="self" type="application/rss+xml" />
	<link>https://bluegecko.dk</link>
	<description>Your remote dba</description>
	<lastBuildDate>Tue, 22 Sep 2009 15:20:39 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.2</generator>
	<item>
		<title>ORA-00054: resource busy and acquire with NOWAIT specified</title>
		<link>https://bluegecko.dk/ora-00054-resource-busy-and-acquire-with-nowait-specified/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ora-00054-resource-busy-and-acquire-with-nowait-specified</link>
					<comments>https://bluegecko.dk/ora-00054-resource-busy-and-acquire-with-nowait-specified/#comments</comments>
		
		<dc:creator><![CDATA[jwilton]]></dc:creator>
		<pubDate>Tue, 22 Sep 2009 15:20:39 +0000</pubDate>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[DDL]]></category>
		<category><![CDATA[ddl_lock_timeout]]></category>
		<category><![CDATA[ORA-00054]]></category>
		<category><![CDATA[ORA-54]]></category>
		<category><![CDATA[Oracle DBA]]></category>
		<category><![CDATA[resource busy and acquire with NOWAIT specified]]></category>
		<guid isPermaLink="false">http://matthias.bluegecko.net/?p=323</guid>

					<description><![CDATA[When trying to perform DDL such as truncate, drop or alter on Oracle objects that are in use by other users, you may encounter the error ORA-00054: resource busy and acquire with NOWAIT specified. This occurs even if you acquire an exclusive DML lock on the table using lock table. Locking a table does not [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>When trying to perform DDL such as truncate, drop or alter on Oracle objects that are in use by other users, you may encounter the error ORA-00054: resource busy and acquire with NOWAIT specified. This occurs even if you acquire an exclusive DML lock on the table using lock table. Locking a table does not guarantee the success of any subsequent DDL statement on a table or associated indexes. DDL statements must obtain the library cache lock in order to perform DDL, and until recently, there has been no manual mechanism to guarantee possession of a library cache lock.<span id="more-323"></span></p>
<p>[code language=&#8221;sql&#8221;]SQL&gt; alter table foo add (bar varchar2(10));<br />
*<br />
ERROR at line 1:<br />
ORA-00054: resource busy and acquire with NOWAIT specified[/code]</p>
<p><strong>A new feature in Oracle 11g</strong> allows you to overcome this problem.  If you would like your DDL to wait for the object to become available, simply specify how long you would like it to wait:</p>
<p>[code language=&#8221;sql&#8221;]SQL&gt; alter session set ddl_lock_timeout = 600;<br />
Session altered.<br />
SQL&gt; alter table foo add (bar varchar2(10));<br />
Table altered.[/code]</p>
<p><strong>Older solutions – 10g and before:</strong></p>
<p>If you don’t have an Oracle version with ddl_lock_timeout, you can still devise a way to get that DDL to run on an active segment. We can use a PL/SQL procedure that loops trying to execute DDL, stopping only when it finally succeeds. <a title="Jonathan Lewis" href="http://www.jlcomp.demon.co.uk/" target="_blank">Jonathan Lewis</a> wrote a simple stored procedure to do this, and it is included here with his permission:</p>
<p>[code language=&#8221;sql&#8221;]create or replace procedure do_ddl(m_sql varchar2) as<br />
  in_use exception;<br />
  pragma exception_init(in_use, -54);<br />
begin<br />
  while true loop<br />
    begin<br />
      execute immediate m_sql;<br />
      exit;<br />
    exception<br />
      when in_use then null;<br />
    end;<br />
    dbms_lock.sleep(0.01);<br />
  end loop;<br />
end;[/code]</p>
<p><strong>Online Redefinition</strong></p>
<p>Online redefinition is also possible in Oracle 9i and above using the dbms_redefinition package.  This package creates interim objects to take DML and store data while the original table is being redefined.  It is useful for a variety of activities that cannot be accomplished with a single DDL statement, such as moving or reorganizing a segment. For most DDL, the PL/SQL procedure above is sufficient and avoids the unnecessary complexity of dbms_redefinition.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://bluegecko.dk/ora-00054-resource-busy-and-acquire-with-nowait-specified/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/

Object Caching 1/92 objects using disk
Page Caching using disk: enhanced 

Served from: bluegecko.dk @ 2026-10-17 13:41:03 by W3 Total Cache
-->