title: Avoid hanging while compiling Oracle package
body: <p>we have a situation where the compiling of a package takes for ever!
  if we compile the package with a new name then it works!</p>
  
  <p>what I understood, Compiling hangs because of locks on the package!</p>
  
  <p>something like this might help identify the problem!</p>
  
  <pre><code>    SELECT s.sid,
         l.lock_type,
         l.mode_held,
         l.mode_requested,
         l.lock_id1,
      FROM   dba_lock_internal l,
         v$session s
      WHERE s.sid = l.session_id
      AND UPPER(l.lock_id1) LIKE '%PROCEDURE_NAME%'
      AND l.lock_type = 'Body Definition Lock';
  </code></pre>
  
  <p>also this</p>
  
  <pre><code>select 
     x.sid 
  from 
     v$session x, v$sqltext y
  where 
     x.sql_address = y.address
  and 
     y.sql_text like '%PROCEDURE_NAME%';
  </code></pre>
  
  <p>is it only <strong>'body Definition Lock'</strong> that prevent the compiling?
  is there any other lock types that prevent the compiling?</p>
  
  <p><strong>how to avoid the locks and do the compiling? by killing the sessions only? is there something else?</strong></p>