sql - Oracle : Swapping table names -


i need load table ~18m records in daily basis, , in order minimize down time on client side, have approach of loading temp swap table names after. see process below

table orginal table, table tmp temporary table

  1. load table tmp
  2. rename table table a_v1
  3. rename table tmp table a
  4. rename table a_v1 table tmp
  5. truncate table tmp in preparation next load

is there other way of swapping table names? or other way achieve this?

thanks lot.

use synonym.

firstly load tablea_yyyymmdd, recreate constraints etc.

then,

create or replace synonym tablea tablea_yyyymmdd 

lastly, if want to, drop previous tablea_yyyymmdd.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -