title: How to bulk update tables with large data
body: <p>I have to update column in one table with the content from column in another table in oracle. Since these tables has around 4 million records each, i am facing difficulty doing the update.</p>
  
  <p><strong>Table A Structure(Staging Table)</strong></p>
  
  <pre><code>Col1    Col2    Col3    Col4
  L1      P1      PC1     D1
  L2      P2      PC2     D1
  L3      P3      PC3     D2
  L4      P3      PC3     D3
  </code></pre>
  
  <p><strong>Table B Structure</strong></p>
  
  <pre><code>Col1    Col2    Col3
  E1      P1      F1
  E2      P1      F2
  E3      P2      F3
  E4      P3      F4
  E5      P4      F5
  </code></pre>
  
  <p>I need to update <strong>Col3</strong> in <strong>table B</strong> with value from <strong>Col4</strong> from <strong>table A</strong> when there is match for <strong>Col2</strong> in <strong>table A and B</strong>.</p>
  
  <p>I tried with merge command but since these 2 tables has millions of records, we are getting space issues on temp table.</p>
  
  <p>Merge command that i used was</p>
  
  <pre><code>merge into b
  using
  (select col2,col4 from a) c
  on c.col2=b.col2
  when matched then update set b.col3=c.col4;
  </code></pre>
  
  <p>Is there better approach to handle this bulk update?</p>