39.2 Manually Creating the Database Schema

When you install the identity applications, you can postpone connecting to the database or creating tables in the database. If you do not have permissions to the database, you might need to choose this option. The installation program creates a SQL file that you can use to create the database schema. You can also recreate the database tables after installation without having to reinstall. To do so, you delete the database for the identity applications and create a new database with the same name.

39.2.1 Using the SQL File to Generate the Database Schema

This section assumes that the installation program created a SQL file that you can execute to generate the database schema. If you do not have the SQL file, see Manually Creating the SQL File to Generate the Database Schema.

NOTE:Do not use SQL*Plus to execute the SQL file. The line lengths in the file exceed 4000 characters.

  1. Stop the Application Server.

  2. Login to the Database Server.

  3. Delete the database that is used by the identity applications.

  4. Create a new database with the same name as the one that was deleted in Step 3.

  5. Navigate to the SQL script that the installation process created, by default in the /installation_path/userapp/sql directory.

  6. (Conditional) For an Oracle database, insert a backslash (/) after the definition of the function CONCAT_BLOB. For example:

      -- Changeset icfg-data-load.xml::700::IDMRBPM
    CREATE OR REPLACE FUNCTION CONCAT_BLOB(A IN BLOB, B IN BLOB) RETURN BLOB AS
                    C BLOB;
                BEGIN
                    DBMS_LOB.CREATETEMPORARY(C, TRUE);
                    DBMS_LOB.APPEND(C, A);
                    DBMS_LOB.APPEND(C, B);
                    RETURN c;
                END;
    /
  7. Have the database administrator run the SQL script to create and configure the User Application database.

  8. Restart Tomcat.

39.2.2 Manually Creating the SQL File to Generate the Database Schema

You can recreate the database tables after installation without having to reinstall and without having the SQL file. This section helps you create the database schema in the event that you do not have the SQL file.

  1. Stop Tomcat.

  2. Log in to the server that hosts your identity applications database.

  3. Delete the existing database.

  4. Create a new database with the same name as the one that you deleted in Step 3.

  5. In a text editor, open the NetIQ-Custom-Install.log file, located by default at the root of the installation directory for the identity applications. For example:

    /opt/netiq/idm/apps/UserApplication
  6. Search and copy the below command from the NetIQ-Custom-Install.log file:

    /opt/netiq/idm/jre/bin/java -Xms256m -Xmx256m  -Dwar.context.name=IDMProv -Ddriver.dn="cn=User Application Driver,cn=driverset1,o=system" -Duser.container="o=data" -jar /opt/netiq/idm/apps/UserApplication/liquibase.jar --databaseClass=liquibase.database.core.PostgresDatabase --driver=org.postgresql.Driver --classpath=/opt/netiq/idm/apps/postgresql/postgresql-9.4.1212jdbc42.jar opt/netiq/idm/apps/UserApplication/IDMProv.war --changeLogFile=DatabaseChangeLog.xml  --url="jdbc:postgresql://localhost:5432/idmuserappdb" --contexts="prov,newdb" --logLevel=info --logFile=/opt/netiq/idm/apps/UserApplication/db.out --username=******** --password=******** update
  7. Log in to the server where you installed the database for the identity applications.

  8. In a terminal, paste the command string that you copied.

    NOTE:The command should be updateSQL. If it is update, change the command to updateSQL.

  9. In the command, replace the asterisks (*) that represent the database username and password with the actual values required to authenticate. Also, ensure the name of the SQL file is unique.

  10. Execute the command.

  11. (Conditional) If the process generates a SQL file instead of populating the database, provide the file to your database administrator to import into the database server. For more information, see Using the SQL File to Generate the Database Schema.

  12. After the database administrator imports the SQL file, start Tomcat.