How to Backup and Restore Lifecycle Query Engine manually for Oracle Database

You can back up and restore data that is indexed by Lifecycle Query Engine (LQE) or Link Index Provider (LDX). The copy of the indexed data can be used in the future to restore LQE or LDX to a previous state.
You can schedule the automatic backup in the LQE application using LQE admin using the steps mentioned here.
In some cases Automatic backup and Restore can take long time , if LQE data is huge, so in that case you can follow below manual steps to backup and Restore LQE.
Bakup LQE 
  1. Log in to the LQE as Admin.
  2. Pause all data providers indexing
  3. Shut down the LQE server.
  4. Go to LQE Server and navigate to the directory which has All TDB directories inside it. Default path is “/server/conf/lqe”
  5. Take backup of below directories, add date and time in the name of backup directory.
    • indexTdb

    • historyTdb

    •  shapeTdb

    • textIndex

    • versionTdb

  6. To take the backup of LQE DB, use the export dump file of LQE database as instructed in the following steps:

    1. Log in to the Oracle database.

      • On Windows: Log in to the Oracle Database host computer as the user who installed Oracle Database, and then open a command prompt.

      • On Linux: Start a terminal session and log in to the Oracle Database host computer with the Oracle user account.

    2. In the command prompt, run the following command to create the directory for placing the exported files:

      • On 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.
    3. Start the SQL command line (SQL*Plus) and connect as user SYSTEM by using the following command:

      • 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. “DBIdentifier” is the Identifier of Oracle DB that you have used for LQE Database.

    4. At the SQL prompt, enter the following commands to create a directory object that is named “dmpdir” for the tmp directory that you created, and to grant read and write access to it for user used for LQE DB, in below command we have used SYSTEM user but this needs to replace by user used for LQE DB.

      • On Windows:

        CREATE OR REPLACE DIRECTORY dmpdir AS 'c:\oraclexe\app\tmp';
        GRANT READ,WRITE ON DIRECTORY dmpdir TO SYSTEM;
      • On Linux:

        CREATE OR REPLACE DIRECTORY dmpdir AS '/usr/lib/oracle/xe/tmp';
        GRANT READ,WRITE ON DIRECTORY dmpdir TO SYSTEM;
    5. Export the LQE DB schema to a dump file named schema.dmp by running the following command:

      • expdp system/oracle@XEPDB1 SCHEMAS=SYSTEM DIRECTORY=dmpdir DUMPFILE=schema.dmp LOGFILE=expschema.log
        Where XEPDB1 is the DB name (Identifier) used to connect to your LQE DB. and SCHEMA name is also need to replace with the Schema used for LQE DB.
        The schema.dmp file and the expschema.log file are written to the dmpdir directory.

  7. Once export completed you can create a folder with prefix LQE and data time, then place the above taken backup to newly created folder which can be use while restoring this backup to LQE in future.
  8. Start the LQE server.

Restore of LQE Backup

  1. Shutdown the LQE.
  2. Go to LQE server and navigate to Server directory where LQE index is stored. Default path is /server/conf/lqe .
    • Rename existing TDB folder.
    • Copy the TDB file which we want to restore. (Backup taken during LQE backup)

  3. Log in to the Oracle database.

    • On Windows: Log in to the Oracle Database host computer as the user who installed Oracle Database, and then open a command prompt.

    • On Linux: Start a terminal session and log in to the Oracle Database host computer with the Oracle user account.

  4. Execute below command to restore LQE DB.

    • impdp SYSTEM/oracle@XEPDB1 SCHEMAS=SYSTEM 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 DB. SCHEMA name also needs to be replace by schema used for LQE DB.

  5. Start the server.

  6. Load the LQE admin UI and on the Data Providers page, resume indexing of all data providers.

  7. All data providers must be up-to date.