title: ORA-03150: end-of-file on communication channel for database link
body: <p>In an Oracle database there's a big PL/SQL procedure being executed periodically that copies data from one DB to another one through a database link and it is failing after some hours with the following error:</p>
  
  <pre><code>ORA-03150: end-of-file on communication channel for database link 
  ORA-02063: preceding line from DBPREMOTE 
  ORA-06512: at "DBLOCAL.JOB_NAME", line 710 
  ...
  ORA-06512: at line 1 
  </code></pre>
  
  <p>Line 710 is the first line of a procedure:</p>
  
  <pre><code> execute immediate 'set constraints all deferred';
  </code></pre>
  
  <p>Then the procedure does some inserts and updates, which I guess are failing at some point due to PK, data not valid or whatever other reason. I guess that the exception is being pointing at that line because it is the first one, not because it is actually failing there, but I don't know for sure the real exception.</p>
  
  <p>Is there any chance I can get the real exception so I can handle it?</p>