Merging the indexed data from the LQE2 instance into the LQE1 instance
Procedure
-
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.
- Stop both Lifecycle Query Engine instances.
- In the lqe.properties file of the LQE1 instance, set this Lifecycle Query Engine property: lqe.restore=true.
- Import the dump data.
- 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.
- 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". - 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.
- On Microsoft Windows:
- 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.
- 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;
- Copy the schema.dmp file that is created at the time of export to the /usr/lib/oracle/xe/tmp location.
- 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.
- If you are restoring the backup to the same DB, then you can directly run the
following command:
- Overwrite the history of the LQE1 instance (not the new LQE1 backup).
-
Copy the following folders from the LQE2 backup to the LQE1 instance:
- Copy /datasets into conf/lqe
-
Copy /metadata into conf/lqe
-
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
-
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. -
Copy the following folders from the LQE2 backup to the LQE1 instance:
- Resume or enable the data metrics collection job on LQE1.