42.3 Manually Generating the Database Schema

You can recreate the database tables after installation without having to reinstall. This section helps you create the database schema.

  1. Stop Tomcat.

    For example:

    /etc/init.d/idmapps_tomcat_init stop
  2. (Conditional) Delete the existing database

  3. (Conditional) Create a new database with the same name as the one that you deleted in Step 2

  4. (Conditional) Clear the database checksums

    1. Log in to your database as idm_rpt_cfg.

    2. Execute the following command for PostgresSQL:

        DO
      $do$
       BEGIN
        IF EXISTS
         (select table_name from information_schema.tables where table_schema = 'public' and table_name = 'databasechangelog')
        THEN
         update databasechangelog set md5sum = null;
        END IF;
      END $do$

      or

      Execute the following command for Oracle:

        BEGIN
       FOR i IN
        (select null from ALL_TABLES where OWNER = user and TABLE_NAME = 'DATABASECHANGELOG')
       LOOP
        EXECUTE IMMEDIATE 'update DATABASECHANGELOG set MD5SUM = NULL';
       END LOOP;
      END;
    3. Log in to your database as idm_rpt_data.

    4. Repeat the commands issued in Step 4.b as the idm_rpt_data user.

  5. Define the JAVA_HOME variable. For example:

    export JAVA_HOME=/opt/netiq/idm/apps/jre
  6. Re-initialize the database using the installed script:

    1. Regenerate the database tables by executing the following command:

      /opt/netiq/idm/apps/IdentityReporting/bin/db-init.sh -cfg_password *** -data_password ***
    2. Generate the SQL files by executing the following command:

      /opt/netiq/idm/apps/IdentityReporting/bin/db-init.sh -cfg_password *** -data_password *** -sql >
      /opt/netiq/idm/apps/IdentityReporting/sql/output.sql

      You use SQL files to regenerate the database tables.

  7. Start Tomcat. For example:

    /etc/init.d/idmapps_tomcat_init start