Merging the indexed data from the LQE2 instance into the LQE1 instance

To ensure that the LQE1 instance contains a complete and accurate data set for reporting, merge the indexed data from the LQE2 instance with the current data on the LQE1 instance. These steps assume that you continue to use the LQE1 instance as the Lifecycle Query Engine server, and not the LQE2 clone.

Procedure

  1. Back up both the LQE1 and LQE2 instances. For more information, see Backing up and restoring Lifecycle Query Engine Relational store for Oracle and Backing up and restoring Lifecycle Query Engine relational store for Db2 database.

    Backing up the LQE1 instance ensures that you preserve the history in case it is deleted accidentally.

    Backing up the LQELQE2 instance provides you with the data you need to merge both Lifecycle Query Engine instances.

  2. Stop both Lifecycle Query Engine instances.
  3. In the lqe.properties file of the LQE1 instance, set this Lifecycle Query Engine property: lqe.restore=true.
  4. Import the dump data.
    1. If you are restoring the backup to the same DB, then you can directly run the following command:
      impdp SYSTEM/oracle@XEPDB1 SCHEMAS=RITRS DIRECTORY=dmpdir DUMPFILE=schema.dmp TABLE_EXISTS_ACTION=replace LOGFILE=impschema.log

      Where XEPDB1 is the DB name (Identifier) used to connect to your LQE rs DB.

    2. If you want to restore the backup to a different or new DB instance, run through the JTS setup, which creates the DW schemas and also load some predefined rows into it. Do one of the following:
      • On Windows: Log in to the Oracle Database XE host computer as the user who installed Oracle Database XE, and then open a command window.
      • On Linux®: Start a terminal session and log in to the Oracle database XE host computer with the Oracle user account.
      Note: Ensure that the environment variables are set according to the instructions in "Setting Environment Variables on the Linux Platform".
    3. At the command prompt, issue the command appropriate to your operating system to create the directory where the exported files will be placed:
      • On Microsoft Windows:
        MKDIR c:\oraclexe\app\tmp
      • On Linux:
        mkdir /usr/lib/oracle/xe/tmp

      Note: The directories that are used in the preceding commands are examples only. You can specify any directory of your choice.

    4. Start the SQL Command Line (SQL*Plus) and connect as user SYSTEM by entering the following at the command prompt:
      sqlplus SYSTEM/password@DBIdentifier

      Where password is the password that you specified for the SYS and SYSTEM user accounts upon installation (Windows) or configuration (Linux) of Oracle database XE and DBIdentifier is the Identifier of Oracle database you have used for LQE RS.

    5. At the SQL command prompt, enter the following commands to create a directory object that is named dmpdir for the tmpdirectory that you created, and to grant read and write access to it for user RITRS.
      • On Windows:
      CREATE OR REPLACE DIRECTORY dmpdir AS 'c:\oraclexe\app\tmp';
      GRANT READ, WRITE ON DIRECTORY dmpdir TO RITRS;
      • On Linux:
      CREATE OR REPLACE DIRECTORY dmpdir AS '/usr/lib/oracle/xe/tmp';
      GRANT READ, WRITE ON DIRECTORY dmpdir TO RITRS;
    6. Copy the schema.dmp file that is created at the time of export to the /usr/lib/oracle/xe/tmp location.
    7. In the command prompt, run the following command:
      impdp SYSTEM/oracle@XEPDB1 SCHEMAS=RITRS DIRECTORY=dmpdir DUMPFILE=schema.dmp TABLE_EXISTS_ACTION=replace LOGFILE=impschema.log

      Here, XEPDB1 is the DB name (Identifier) used to connect to your LQE rs database.

  5. Overwrite the history of the LQE1 instance (not the new LQE1 backup).
    1. Copy the following folders from the LQE2 backup to the LQE1 instance:
      • Copy /datasets into conf/lqe
      • Copy /metadata into conf/lqe

    2. In the LQE1 instance, delete the following folders, which are subfolders of what you copied.
      • conf/lqe/datasets/history/indexTdb
      • conf/lqe/datasets/history/textIndex
    3. Copy the LQE1 history folders to the datasets folders.
      • Copy conf/lqe/historyTdb to conf/lqe/datasets/history/indexTdb
      • Copy conf/lqe/historyText to conf/lqe/datasets/history/textIndex
    The LQE1 instance now contains fully indexed, up-to-date data. Your work with the LQE2 instance is complete.
  6. Resume or enable the data metrics collection job on LQE1.