Using the Teradata MultiLoad (MLoad) Utility to Load Initial-State Data

You can use the Teradata MultiLoad (MLoad) utility to process and load initial-state data into a Teradata database. The MLoad utility can only be used with the Event Replicator Target Adapter to load initial-state data; it cannot be used for transactional data. It can load UTF8 data.

Note:
The MLoad utility is supported in Windows environments only. In addition, composite keys are not supported when using the MLoad utility with Event Replicator Target Adapter.

This document covers the following topics:


Prerequisites

The following prerequisites must be met before the Teradata MLoad utility can be used to load initial-state data to a Teradata database, via the Event Replicator Target Adapter:

  • The Teradata utilities supporting the MLoad utility must be installed on the same machine as the Event Replicator Target Adapter.

  • Be sure there is enough space to accommodate the DAT files that will be created by this processing.

  • After installing the Teradata MLoad utility, it must be configured. According to Teradata MLoad utility configuration rules, you should add entries in the Windows HOSTS file that map the TDPIDs (Teradata Director Program Identifier) with the Teradata databases and their hosts. When the MLoad utility is invoked for a particular target, the Event Replicator Target Adapter will relay the TDPID provided in the Loader section of the Target Database Options entry definition (in Event Replicator Target Adapter Administration) into the Teradata .login command. For example:

    #
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    #
    
    127.0.0.1       localhost
    n.n.n.n         tdpid tdpidcop1
    

    The following substitutions are used in this example:

    Term Description
    n.n.n.n The specific TCP/IP address for the named TDPID where the Teradata database expected to interact with the MLoad utility is running.
    tdpid The Teradata Director Program Identifier (TDPID); usually the first eight characters of the Teradata database name or the Teradata service name.

    Teradata database names can be up to 30 characters long. However, MLoad restrictions for Teradata releases up to Version 12 require that TDPIDs be eight (8) characters or less.

    Event Replicator Target Adapter current logic dynamically determines the TDPID using the first eight characters of the Teradata service name specified in the Loader options of the database option definition created using the Event Replicator Target Adapter Administration tool. If you do not supply a service name, the first eight characters of the Teradata database name is used.

    Whatever TDPID is used must also be present in the HOSTS file. Be sure that the specifications in the database option definition and the specification in the HOSTS file match.

    tdpidcop1 Teradata requires that you specify a second parameter in the format tdpidcop1, where tdpid is the TDPID you specified above and "cop1" is a literal. For example, if you specify "A2345678" as your TDPID, you would specify "A2345678cop1" for this parameter.

Limitations

You can only use the MLoad utility to load initial-state data if:

  • Composite keys are not used in the data.

  • You are running Event Replicator Target Adapter, Teradata, and the MLoad utility in Windows environments.

Enabling Teradata MLoad Utility Initial-State Processing

Start of instruction setTo enable Teradata MLoad utility initial-state processing, complete the following steps:

  1. Using the Administration tool, configure a target definition for your Teradata database. For more information, read Configuring Target Definitions for Event Replicator Target Adapter.

    Note:
    If you intend to load UTF-8 data to your Teradata database, be sure you have applied the appropriate Event Replicator Target Adapter hot fix and that you have specified the "CHARSET=utf8" parameter in the data source URL. For more information about the hot fixes that support this, refer to the README file provided with Event Replicator Target Adapter.

  2. Using the Administration tool, create a specific target processing option definition for your Teradata database. For this definition you must:

    • Select the Convert Hyphen option (check it) on the target processing option definition panel.

    • In the Loader options area of the target processing option definition panel, select the Use Loader check box (check it).

    • In the Loader options area of the target processing option definition panel, specify the Teradata Director Program Identifier (TDPID) in the Oracle Service or Teradata Tdpip field. This is usually the first eight characters of the Teradata database name or the Teradata service name. Teradata database names can be up to 30 characters long. However, MLoad restrictions for Teradata releases up to Version 12 require that TDPIDs be eight (8) characters or less. Event Replicator Target Adapter current logic dynamically determines the TDPID using the first eight characters of the name specified in this field. If you do not supply a name, the first eight characters of the Teradata database name is used. Whatever TDPID is used must also be present in the HOSTS file.

    • In the Loader options area, provide a value for the Path to Loader Executable field, identifying the full path of the Teradata MLoad utility executable. For example:

      C:\Program Files\NCR\teradata client\bin\mload.exe

    Save the target processing option definition with the same name as the target definition you created in Step 1.

  3. When all processing options are specified, start initial-state processing, directing the output to the Event Replicator Target Adapter via a GFFT you created (using the Data Mapping Tool or the Adabas Event Replicator Subsystem) for the Teradata database.

    For more information on this, read Requesting Initial-State Data.

    The Event Replicator Target Adapter will collect the initial-state records and send them to the Teradata MLoad utility to be loaded to your Teradata database.

    Note:
    Some errors might prevent the MLoad utility from restoring primary and foreign keys, indexes, and the unique index of tables. We recommend that you examine the MLoad utility log files to determine if such an error occurred. For more information, read Processing Output.

Processing Output

The output from this processing includes:

  • Various MLoad utility processing files

  • MLoad utility log files from the processing

  • Data files (.mlddat files) containing the initial-state data received by the Event Replicator Target Adapter prior to being processed by the MLoad utility.

All output files are written to the \logs subdirectory of your Event Replicator Target Adapter installation.

Processing Files

The Event Replicator Target Adapter’s MLoad utility processing creates three processing files per table loaded. The following processing files are stored in the \logs subdirectory of your Event Replicator Target Adapter installation:

  • xxxx.bat (where xxxx is the table name) file: This .bat file is used to run the MLoad utility.

  • xxxx.mldctl (where xxxx is the table name) file: This is the control file for the MLoad utility processing.

  • One or more xxxx.mlddat (where xxxx is the table name) files: These files contain the data to be loaded to the database tables by the MLoad utility. These files can take a good deal of space, so make sure that there is enough space to accommodate them and be sure to manually delete them when initial-state processing has completed successfully.

Log Files

Two kinds of log files are produced by Event Replicator Target Adapter MLoad utility processing: a primary log file and multiple processing log files. All log files are stored in the \logs subdirectory of your Event Replicator Target Adapter installation.

  1. The Teradata MLoad utility primary log files make references to the processing log files. The primary log files have names in the format xxxx_yymmdd_hhmmss.out, where xxxx is the table name, yymmdd is the date of the log file, and hhmmss is the time the log file was last updated. We recommend that you review these primary log files carefully to ensure that the MLoad utility had no problems restoring primary and foreign keys, indexes, or the unique index of tables. If MLoad utility processing fails for some reason, we recommend reviewing these primary .out log files first when resolving the problem, proceeding then to the processing log files, as necessary.

  2. Multiple processing log files are created, one for each MLoad process executed by the Event Replicator Target Adapter. These processing log files have names in the format Multiloadprocess-yyyy-mm-dd-hh-mm-ss-nnnn.log, where yyyy-mm-dd is the processing date (year, month, and day) and hh-mm-ss-nnnn represents the processing time (hours, minutes, seconds, and milliseconds).