Close popover

Table of Contents

Moving the FACT table records

Version:

Before you perform this task, make sure you have full access to the source and the destination databases (you need the database admin privileges).

  1. Create TNS entries.

  2. Connect to the source database.

  3. Move the data:

    • If a table does not exist, execute the following script:

      COPY FROM <source_user_name>/<source_pwd>@<source_tnsname> TO <target_user_name>/<target_pwd>@<target_tnsname> CREATE PR_DATA_IH_FACT USING SELECT * FROM PR_DATA_IH_FACT;

    • If a table exists with the exact same columns:

      1. Make sure there are no primary key (PK) constraints on the PXFACTID column in the destination database and do not move any constraints.
      2. Execute the following script:

        COPY FROM <source_user_name>/<source_pwd>@<source_tnsname> TO <target_user_name>/<target_pwd>@<target_tnsname> INSERT PR_DATA_IH_FACT USING SELECT * FROM PR_DATA_IH_FACT;

  • 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.