Merging the dimension records
Before you perform this task, make sure that all the dimension tables are created and have index on the PZID column. If you want to merge the dimension records from the source database to the target database, repeat this procedure for all the dimension tables.
- Connect to the target database.
- Copy the table from the source database to a temporary table in the destination
database.
COPY FROM <source_user_name>/<source_pwd>@<source_tnsname> TO <target_user_name>/<target_pwd>@<target_tnsname> CREATE PR_DATA_IH_DIM_<DIMENSION_NAME>_STAGE USING SELECT * FROM PR_DATA_IH_DIM_<DIMENSION_NAME>;
- Merge the records from the temporary table to the actual dimension table.
MERGE INTO PR_DATA_IH_DIM_<DIMENSION_NAME> T USING PR_DATA_IH_DIM_<DIMENSION_NAME>_STAGE S ON (S.PZID = T.PZID) WHEN NOT MATCHED THEN INSERT (T.column1 [, T.column2 ...]) VALUES (S.column1 [, S.column2 ...]);
- Commit changes.
COMMIT;
- Delete the temporary table.
DROP TABLE PR_DATA_IH_DIM_<DIMENSION_NAME>_STAGE;
Previous topic Moving the FACT table records Next topic Deleting the records from the FACT table