Refreshing Periodically

This scenario loads new data in a data warehouse table periodically from some other source.

About this task

The scenario assumes that the table is type STANDARD during normal operation and that the CREATE EXTERNAL TABLE statement has been previously executed and the EXPRESS keyword was specified in the USING clause.

To refresh a table periodically

Procedure

  1. Drop all indexes on the table.
  2. Alter the table to type RAW.
    ALTER TABLE tab1 TYPE(RAW);
  3. Load the new data in the table.
    INSERT INTO tab1 SELECT * FROM ext_tab

    This insert statement quickly appends new data to the end of the table, and the operation uses very little log space.

  4. Verify the integrity of the data.
  5. Change the table to type STANDARD.
    ALTER TABLE tab1 TYPE(STANDARD);
  6. Re-create indexes on the table so that queries run more quickly.
  7. Perform a level-0 backup to enable you to restore the table later, if necessary. You do not need to perform this level-0 backup if it would be just as easy to reload the table from the original source in the case of a problem.