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
- load table tmp
- rename table table a_v1
- rename table tmp table a
- rename table a_v1 table tmp
- 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
Post a Comment