Precise Instantiation Using the Initial Load Method for Db2 for i

Oracle GoldenGate supports instantiation using initial load method and database utilities. The following topics describe the steps to perform instantiation using the initial load method.

Parameter Settings for Initial Load Extract and Replicat

To use Replicat to establish the target data, you use an initial-load Extract to capture records from the source tables and write them to an Extract file in canonical format. From the file, an initial-load Replicat loads the data using the database interface. During the load, the change-synchronization groups capture and replicate incremental changes, which are then reconciled with the results of the load.

During the load, the records are applied to the target database one record at a time, so this method may be considerably slower than using a native Db2 for i load utility. This method permits data transformation to be done on either the source or target system.

To Configure a Load from File to Replicat

  1. From the Admin Client, connect to the source deployment.
  2. Edit the parameters for the initial-load Extract parameter file. This Extract should have a different name from the Extract groups that capture the transactional data.
    EDIT PARAMS initial-load Extract name
    
  3. Enter the parameters listed in the following table in the order shown, starting a new line for each parameter statement.
    --  E X T I N I T . p r m
    --  File-Based Initial Load Extract Parameter File
    --
    Extract     EXTINIT
    UseridAlias oggadmin
    ExtFile     CC Megabytes 2000 Purge
    Table       user01.*, SQLPredicate "As Of SCN 1609723";
  4. Enter any appropriate optional Extract parameters listed in Reference for Oracle GoldenGate for Windows and UNIX.
  5. Save and close the parameter file.
  6. On the target system, issue the following command to create an initial-load Replicat parameter file. This Replicat should have a different name from the Replicat group that applies the transactional data.
    EDIT PARAMS initial-load Replicat name
    
  7. Enter the parameters listed in the following table for setting up initial load Replicat:

    Table 8-1 Initial Load Replicat Parameters for Loading Data from File to Replicat

    Parameter Description
    END RUNTIME

    Directs the initial-load Replicat to terminate when the load is finished.

    USERIDALIAS

    Specifies database connection information.

    EXTFILE path name |
    EXTTRAIL path name
    • path name is the relative or fully qualified name of the file or trail.

    • Use EXTTRAIL only if you used the MAXFILES option of the RMTFILE parameter in the Extract parameter file.

    Specifies the input Extract file specified with the Extract parameter EXTFILE.

    SOURCEDEFS file name |
    ASSUMETARGETDEFS
    • Use SOURCEDEFS if the source and target tables have different definitions. Specify the relative or fully qualified name of the source-definitions file generated by the DEFGEN utility.

    • Use ASSUMETARGETDEFS if the source and target tables have the same definitions.

    Specifies how to interpret data definitions.

    MAP owner.table,
    TARGET owner.table;
    • owner is the schema name.

    • table is the name of a table or a wildcard definition for multiple tables. To exclude tables from a wildcard specification, use the MAPEXCLUDE parameter.

    Specifies a relationship between a source and target table or tables.

  8. Enter any appropriate optional Replicat parameters listed in the Reference for Oracle GoldenGate for Windows and UNIX.
  9. Save and close the file.

Perform Instantiation from File to Replicat Using Initial Laod

  1. Make certain that you have addressed the requirements in Prerequisites for Instantiating for Db2 for i.

  2. Connect to the source deployment, in not connected already.

  3. On the source system, start the primary Extract or Extract groups to start change extraction.

    START EXTRACT primary Extract group name
  4. From the directory where Oracle GoldenGate is installed on the source system, start the initial-load Extract as follows:

    $ START EXTRACT initial-load Extract name REPORTFILE path name
    

    Where: initial-load Extract name is the name of the initial-load Extract that you used when creating the parameter file, and path name is the relative or fully qualified name of the Extract report file.

  5. Verify the progress and results of the initial extraction by viewing the Extract report file using the operating system's standard method for viewing files.

  6. Wait until the initial extraction is finished.

  7. On the target system, start the initial-load Replicat.

    $ START REPLICAT initial-load Replicat name REPORTFILE path name
    

    Where: initial-load Replicat name is the name of the initial-load Replicat that you used when creating the parameter file, and path name is the relative or fully qualified name of the Replicat report file.

  8. When the initial-load Replicat is finished running, verify the results by viewing the Replicat report file using the operating system's standard method for viewing files.

  9. On the target system, start change replication.

    START REPLICAT Replicat group name
    
  10. On the target system, issue the following command to verify the status of change replication.

    INFO REPLICAT Replicat group name
    
  11. Continue to issue the INFO REPLICAT command until you have verified that Replicat posted all of the change data that was generated during the initial load. For example, if the initial-load Extract stopped at 12:05, make sure Replicat posted data up to that point.

  12. On the target system, issue the following command to turn off the HANDLECOLLISIONS parameter and disable the initial-load error handling.

    SEND REPLICAT Replicat group name, NOHANDLECOLLISIONS
    
  13. On the target system, edit the Replicat parameter file to remove the HANDLECOLLISIONS parameter. This prevents HANDLECOLLISIONS from being enabled again the next time Replicat starts.

    Caution:

    Do not use the VIEW PARAMS or EDIT PARAMS command to view or edit an existing parameter file that is in a character set other than that of the local operating system (such as one where the CHARSET option was used to specify a different character set). View the parameter file from outside Admin Client if this is the case; otherwise, the contents may become corrupted.

  14. Save and close the parameter file.

    From this point forward, Oracle GoldenGate continues to synchronize data changes.