 |
|
Oracle EXCHANGE PARTITION tips
Oracle Tips by Burleson Consulting
|
|
|
|
|
Oracle EXCHANGE PARTITION
One of the most time-consuming processes in any data warehouse is the
creation of the Extract, Transformation and Load (ETL) processes. One of the
best features in Oracle data warehousing is the ability to swap-out
standard Oracle tables and partitioned tables.
Here is the syntax of the EXCHANGE PARTITION command:
ALTER TABLE <table_name>
EXCHANGE PARTITION
<partition_name>
WITH TABLE <new_table_name>
<including |
excluding> INDEXES
<with | without>
VALIDATION
EXCEPTIONS INTO <schema.table_name>;
In Oracle Data Warehouse ETL, the incoming data is loaded into a
“staging” table, using Oracle Data Pump or SQL*Loader, normally
with:
-
Deferred index building
-
Adding rows into new freelist blocks (the APPEND
clause)
-
Using direct-path loading (nologging,
unrecoverable)
Preparing a new table partition is resource-intensive. Loading
the new data into a staging area relieves any concurrent-user issues,
because the staging table is segregated from the “live” data
warehouse.
Once the data is loaded into the staging table you can build the
indexes, estimate the CBO statistics, and use the “exchange
partition” command to load the table into the production environment
with minimal impact.
 |
If you like Oracle tuning, you
might enjoy my book "Oracle
Tuning: The Definitive Reference", with 950 pages of tuning tips and
scripts.
You can buy it direct from the publisher for 30%-off and get instant
access to the code depot of Oracle tuning scripts. |
|