Close popover

Table of Contents

Merging the dimension records

Version:

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.

  1. Connect to the target database.

  2. 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>;

  3. 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 ...]);

  4. Commit changes.

    COMMIT;

  5. Delete the temporary table.

    DROP TABLE PR_DATA_IH_DIM_<DIMENSION_NAME>_STAGE;

  • Applying sample scripts for archiving and purging

    The interaction history tables contain transactional data which may grow fast. By using the sample scripts, the users can archive the data in the archiving database and delete (purge) the records from the source database. The scripts allow you to move the FACT table records, merge the Dimension records, and delete the records from the FACT table. Before you use any of the scripts, back up the source and target interaction history tables and create indexes on the columns. Indexes improve performance when you read data from the archived tables.

  • Applying interaction history scripts in Oracle databases

    Use interaction history scripts with Oracle databases to archive or purge the interaction history tables on Windows OS. The scripts allow you to move the FACT table records, merge the Dimension records, and delete the records from the FACT table.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.