After a thorough and comprehensive tuning review...a revised version is below..
create or replace procedure do_ddl(m_sql varchar2)
as
in_use exception ;
pragma exception_init(in_use, -54);
begin
while true loop
begin
execute immediate m_sql;
exit;
exception
when in_use then null;
-- when others then raise;
end;
dbms_lock.sleep(0.01);
end loop;
end;
/
:-)
--- Jonathan Lewis <jonathan@(protected) > wrote: >
> I thought it was pretty good for five minutes -
> and I did leave in a CPU-saving sleep.
> The timeout problem is left as an exercise
> for the reader.
>
> Held cursors shouldn 't be a problem - that 's
> why library cache locks are called breakable
> parse locks. ( "should " and "won 't " are, of
> course, two different words).
>