Con el paquete DBMS_LOCK  podemos establecer bloqueos de usuario (PL/SQL User Locks (UL)) con los que podremos parar la ejecución de un procedure si al ejecutarlo nos encontramos con que un determinado bloqueo o lock está en proceso.

 

[email protected]:~> sqlplus "/ as sysdba"

SQL*Plus: Release 11.1.0.7.0 - Production on Tue Nov 25 17:07:16 2014

Copyright (c) 1982, 2008, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> 



SQL> grant execute on sys.dbms_lock to mydbuser;

Grant succeeded.