Merging the dimension records in Microsoft SQL Server databases
Version:
Before you perform this task, make sure that all the dimension tables are created and have index on the PZID column.
-
Connect to the target database.
-
Merge the records from the source table to the dimension table.
MERGE INTO <TARGET_DATABASE>.<TARGET_SCHEMA>.PR_DATA_IH_DIM_<DIMENSION_NAME> T USING <SOURCE_DATABASE>.<SOURCE_SCHEMA>.PR_DATA_IH_DIM_<DIMENSION_NAME> SON (T.PZID = S.PZID) WHEN NOT MATCHED THEN INSERT (column1 [, column2 ...]) VALUES (S.column1 [, S.column2 ...]);
- 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.