Configuring the Loader

Before using the Loader package, you may need to configure the classpath and some environment variables. You may also want to change the properties file used by the Loader.

  1. Windows In the WC_installdir\bin\setenv.bat file set the following environment variables:
    • JAVA_HOME
    • DB2_DRIVER
    • ORACLE_HOME
    • ORACLE_DRIVER
    • ORACLE_CLASSPATH

    These environment variables are set in setenv.bat and used in setdbenv.db2.bat or setdbenv.oracle.bat, depending on the database that you are using.

    DB2Windows Set the classpath system-environment variable to include db2/dbconnect.zip for DB2 running on Windows with the sqlimport, load, import, or delete method.

    OracleAIXLinuxSun Solaris Operating EnvironmentWindows Set the classpath system-environment variable to include oracle/dbconnect.zip for the Oracle database running in Windows, AIX, Solaris, or Linux environments with the sqlimport, load, import, or delete method.

  2. OracleAIXLinuxSun Solaris Operating EnvironmentWindows If you want to run the Loader command using Oracle 9i but the environment variables are pointing to your older Oracle 8i drivers, you may need to update three variables in the environment-setting files to point to the Oracle 9i drivers. For the Windows operating system, the new lines will look similar to the following:
      SET ORACLE_CLASSPATH=C:\oracle9\ora9\jdbc\lib\classes12.zip;
      SET ORACLE_DRIVER=C:\oracle9\ora9\jdbc\lib\classes12.zip; 
      SET ORACLE_HOME=C:\oracle9\ora9
    
  3. If you use the Loader package to load large documents, change the following settings:
    Java Virtual Machine (JVM) heap size
    By default, the maximum amount of memory allocated to the JVM heap is 64 MB. If this is not increased, the JVM can eventually run out of memory during the load process. The maximum amount of memory allocated to the Java heap can be varied by using the JVM -mx option in the Java command.
    Trace logging

    The trace logger can exhaust the JVM heap when loading a large XML document. Trace information is used mostly for debugging a run if the run fails. If tracing the load process is not necessary, the trace should be turned off. There is a significant performance gain when trace is turned off. The trace is turned off by modifying the logging configuration XML document.

    The default logging configuration file is WCALoggerConfig.xml for directions, see Configuring logging for the Loader package.

    Commit count

    The default commit count for the Loader when it is operating in SQL import mode is 1. By default, therefore, transactions are committed for every update or insert into the database. To improve the performance of the Loader for large documents, the commit count should be increased. After taking into consideration the size of the input.xml file, you may use a commit count larger than the number of records in your file. This enables rollback of the entire input.xml file if an error occurs.

    The commit count for the Loader is changed using the -commitcount count option for the Load command (where count is the number of statements executed before the transaction is committed).

  4. Configure the MassLoadCustomizer.properties file.