sql - What does it do to create a Partition Switching table? Then how can I fill these tables? -
what create partition switching table? how can fill these tables?
a partition switching table normal table. must identical table want switch into.
with regards how fill table? might need post more info... how filling other tables? it's table. fill see fit.
the trick is....
once have table filled , want switch in against table run this:
truncate table targettable; alter table sourcetable switch targettable;
you can add though i've never tested (i today found today, here https://littlekendra.com/2017/01/19/why-you-should-switch-in-staging-tables-instead-of-renaming/)
truncate table targettable; alter table sourcetable switch targettable ( wait_at_low_priority (max_duration = 1 minutes, abort_after_wait = blockers) );
this replaces targettable data in sourcetable
as always, has done before , me , blogged it, , it's google away
https://sqlsunday.com/2014/08/24/reloading-fact-tables-with-zero-downtime/
Comments
Post a Comment