Merging Event Manager tables

If you are upgrading from an installation prior version 10.0, you might have Event Manager data stored in tables that are separate from the master data tables. Before upgrading, merge the tables into the primary database.

Before you begin

The following are the names of the Event Manager tables:
  • ADAPTERDEF
  • CDEVENTCAT
  • PRODENTITY
  • ENTITYEVENTCAT
  • EVENT
  • CDEVENTDEFTP
  • EVENTDEFEXTRULE
  • PROCESSACTION
  • PROCESSCONTROL
  • CACHINGSERVICE
  • ENTITYEVENTCATOPT
Determine whether those tables are stored in a separate database.

About this task

To merge the Event Manager tables run the scripts contained in the EM_Merge folder, located in the /database/Upgrade directory.

Procedure

  1. Navigate to the EM_Merge directory: MDM_INSTALL_HOME/database/Upgrade/EM_Merge
    Note: The EM_Merge directory also appears in certain subdirectories within the Upgrade directory. Regardless of where it appears in the hierarchy, the contents of the directory are always the same.
  2. For the scripts in EM_Merge/DB2/Standard/ddl folder, change the placeholder tags in all of the scripts as follows:
    1. Replace <SCHEMA> with the schema name or owner with necessary privileges. This must be in uppercase.
    2. Replace <TABLE_SPACE> with a tablespace name that refers to the tablespace where the data is located.
    3. Replace <INDEX_SPACE> with a tablespace name that refers to the tablespace where the indexes are located.
    4. Replace <LONG_SPACE> with a valid tablespace name for storing long type data, either CLOB or XML data.
    5. Replace <PATH> with the location where the data files will be stored.
  3. Connect to your current Event Manager database.
  4. Export the current Event Manager data, first defining the <PATH> inside the script, then from the command line run the following script:
    db2 -tvf ExportEMData.sql  -l <log_file_name>
  5. Connect to your current MDM database, and set the DMD Schema Name in following scripts by running the command db2 -tvf <script_name> -l <log_file_name> for each of the following:
    1. CreateEM_Tables.sql to create EM tables
    2. CreateEM_Hist_Tables.sql to create EM history tables
    3. CreateEM_Ix.sql to create EM Indexes
    4. CreateEM_Fk.sql to create EM foreign Keys
  6. Import the Event Manager data you got it from step 3, using the same <PATH>, then from the command line run the scripts, using the command:
    db2 -tvf ImportEMData.sql  -l <log_file_name>
  7. Run the following commands to create Event Manager triggers, and make sure that you choose the same type of trigger with your MDM database:
    1. Create simple triggers by running:
      db2 -v -td@ -f CreateEM_Triggers_simple.sql -l <log_file_name>
    2. Create compound triggers by running:
      db2 -v -td@ -f CreateEM_Triggers_compound.sql -l <log_file_name>
    3. Optional: Create simple delete triggers by running:
      db2 -v -td@ -f CreateEM_Triggers_delete_simple.sql -l <log_file_name>
    4. Optional: Create compound delete triggers by running:
      db2 -v -td@ -f CreateEM_Triggers_delete_compound.sql -l <log_file_name>
  8. Optional: After you have verified that you have successfully merged the Event Manager database into the database, you can drop the old Event Manager database and schema.


Last updated: 22 Apr 2016