Loading Data with an Oracle GoldenGate Direct Load

To use an Oracle GoldenGate direct load, you run an Oracle GoldenGate initial-load Extract to extract the source records and send them directly to an initial-load Replicat task. A task is started dynamically by the Manager process and does not require the use of a Collector process or file. The initial-load Replicat task delivers the load in large blocks to the target database. Transformation and mapping can be done by Extract, Replicat, or both. During the load, the change-synchronization groups extract and replicate incremental changes, which are then reconciled with the results of the load.

To control which port is used by Replicat, and to speed up the search and bind process, use the DYNAMICPORTLIST parameter in the Manager parameter file. Manager passes the list of port numbers that are specified with this parameter to the Replicat task process. Replicat first searches for a port from this list, and only if no ports are available from the list does Replicat begin scanning in ascending order from the default Manager port number until it finds an available port.

This method supports standard character, numeric, and datetime data types, as well as CLOB, NCLOB, BLOB, LONG, XML, and user-defined datatypes (UDT) embedded with the following attributes: CHAR, NCHAR, VARCHAR, NVARCHAR, RAW, NUMBER, DATE, FLOAT, TIMESTAMP, CLOB, BLOB, XML, and UDT. Character sets are converted between source and target where applicable.

This method supports Oracle internal tables, but does not convert between the source and target character sets during the load.

To Load Data with an Oracle GoldenGate Direct Load

  1. Make certain to satisfy "Prerequisites for Initial Load".
  2. On the source and target systems, run GGSCI and start Manager.
    START MANAGER
    

    Note:

    In a Windows cluster, start the Manager resource from the Cluster Administrator.

  3. On the source, issue the following command to create the initial-load Extract.
    ADD EXTRACT initial-load_Extract, SOURCEISTABLE
    

    Where:

    • initial-load_Extract is the name of the initial-load Extract, up to eight characters.

    • SOURCEISTABLE designates Extract as an initial-load process that reads complete records directly from the source tables. Do not use any of the other ADD EXTRACT service options or datasource arguments.

  4. On the source system, issue the following command to create an initial-load Extract parameter file.
    EDIT PARAMS initial-load_Extract
    
  5. Enter the parameters listed in Table 7-2 in the order shown, starting a new line for each parameter statement. The following is a sample initial-load Extract parameter file for an Oracle GoldenGate direct load.
    EXTRACT initext
    SOURCEDB mydb, USERIDALIAS ogg
    RMTHOSTOPTIONS ny4387, MGRPORT 7888, ENCRYPT AES 192 KEYNAME mykey
    RMTTASK REPLICAT, GROUP initrep
    TABLE hr.*;
    TABLE sales.*;
    

    Table 7-2 Initial-load Extract Parameters for Oracle GoldenGate Direct Load

    Parameter Description
    EXTRACT initial-load_Extract

    Specifies the initial-load Extract.

    SOURCEDB dsn
    [, USERIDALIAS alias, options |
    , USERID user, options]

    Specifies database connection information.

    SOURCEDB specifies the source datasource name (DSN). See Parameters and Functions Reference for Oracle GoldenGate for more information.

    USERID and USERIDALIAS specify database credentials if required.

    RMTHOSTOPTIONS hostname,
    MGRPORT portnumber
    [, ENCRYPT algorithm KEYNAME keyname]

    Specifies the target system, the port where Manager is running, and optional encryption of data across TCP/IP.

    RMTTASK replicat,
    GROUP initial-load_Replicat
    • initial-load_Replicat is the name of the initial-load Replicat group

    Directs Manager on the target system to dynamically start the initial-load Replicat as a one-time task.

    TABLE container.owner.object;

    Specifies the fully qualified name of an object or a fully qualified wildcarded specification for multiple objects. If the database is an Oracle multitenant database, the object name must include the name of the container or catalog unless SOURCECATALOG is used.

    CATALOGEXCLUDE

    SCHEMAEXCLUDE

    TABLEEXCLUDE

    EXCLUDEWILDCARDOBJECTSONLY

    Parameters that can be used in conjunction with one another to exclude specific objects from a wildcard specification in the associated TABLE statement. See Parameters and Functions Reference for Oracle GoldenGate for details.

  6. Enter any appropriate optional Extract parameters listed in Parameters and Functions Reference for Oracle GoldenGate.
  7. Save and close the file.
  8. On the target system, issue the following command to create the initial-load Replicat task.
    ADD REPLICAT initial-load_Replicat, SPECIALRUN
    

    Where:

    • initial-load_Replicat is the name of the initial-load Replicat task.

    • SPECIALRUN identifies the initial-load Replicat as a one-time run, not a continuous process.

  9. On the target system, issue the following command to create an initial-load Replicat parameter file.
    EDIT PARAMS initial-load_Replicat
    
  10. Enter the parameters listed in Table 7-3 in the order shown, starting a new line for each parameter statement. The following is a sample initial-load Replicat parameter file for an Oracle GoldenGate direct load.
    REPLICAT initrep
    TARGETDB mydb, USERIDALIAS ogg
    SOURCEDEFS /ggs/dirdef/source_defs
    MAP hr.*, TARGET hr.*;
    MAP sales.*, TARGET hr.*;
    

    Table 7-3 Initial-load Replicat parameters for Oracle GoldenGate Direct Load

    Parameter Description
    REPLICAT initial-load_Replicat

    Specifies the initial-load Replicat task to be started by Manager. Use the name that you specified when you created the initial-load Replicat.

    [TARGETDB dsn | container]
    [, USERIDALIAS alias, options |
    , USERID user, options]

    Specifies database connection information.

    TARGETDB specifies the target datasource name (DSN) or Oracle container. See Parameters and Functions Reference for Oracle GoldenGate for more information.

    USERID and USERIDALIAS specify database credentials if required.

    {SOURCEDEFS full_pathname} |
    ASSUMETARGETDEFS
    • Use SOURCEDEFS if the source and target tables have different definitions. Specify the source-definitions file generated by DEFGEN.

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

    Specifies how to interpret data definitions.

    SOURCECATALOG

    Specifies a default source Oracle container . Enables the use of two-part names (schema.object) where three-part names otherwise would be required for those databases. You can use multiple instances of this parameter to specify different default containers or catalogs for different sets of MAP parameters.

    MAP container.owner.object,
    TARGET owner.object[, DEF template]
    ;

    Specifies a relationship between a source object or objects and a target object or objects. MAP specifies the source object, and TARGET specifies the target object.

    For the source object, specify the fully qualified name of the object or a fully qualified wildcarded specification for multiple objects. For an Oracle multitenant container database, the source object name must include the name of the container or catalog unless SOURCECATALOG is used.

    For the target object, specify only the owner.object components of the name, regardless of the database. Replicat can only connect to one Oracle container. Use a separate Replicat process for each container or catalog to which you want to load data.

    See Specifying Object Names in Oracle GoldenGate Input for guidelines for specifying object names in parameter files.

    The DEF option specifies a definitions template.

    CATALOGEXCLUDE

    SCHEMAEXCLUDE

    MAPEXCLUDE

    EXCLUDEWILDCARDOBJECTSONLY

    Parameters that can be used in conjunction with one another to exclude specific source objects from a wildcard specification in the associated MAP statement. See Parameters and Functions Reference for Oracle GoldenGate for details.

  11. Enter any appropriate optional Replicat parameters listed in the Parameters and Functions Reference for Oracle GoldenGate.
  12. Save and close the parameter file.
  13. On the source system, start change extraction.
    START EXTRACT group
    
  14. View the Replicat parameter file to make certain that the HANDLECOLLISIONS parameter is listed. If not, add the parameter to the file.
  15. (Oracle, if replicating sequences) Issue the DBLOGIN command as the user who has EXECUTE privilege on update.Sequence.
    GGSCI> DBLOGIN USERID DBLOGINuser, PASSWORD password [encryption_options]
    
  16. (Oracle, if replicating sequences) Issue the following command to update each source sequence and generate redo. From the redo, Replicat performs initial synchronization of the sequences on the target. You can use an asterisk wildcard for any or all characters in the name of a sequence (but not the owner).
    FLUSH SEQUENCE owner.sequence
    
  17. On the source system, start the initial-load Extract.
    START EXTRACT initial-load_Extract

    Note:

    Do not start the initial-load Replicat. The Manager process starts it automatically and terminates it when the load is finished.

  18. On the target system, issue the following command to find out if the load is finished. Wait until the load is finished before going to the next step.
    VIEW REPORT initial-load_Replicat
    
  19. On the target system, start change replication.
    START REPLICAT group
    
  20. On the target system, issue the following command to verify the status of change replication.
    INFO REPLICAT group
    
  21. 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.
  22. On the target system, issue the following command to turn off the HANDLECOLLISIONS parameter and disable the initial-load error handling.
    SEND REPLICAT group, NOHANDLECOLLISIONS
    
  23. 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 GGSCI if this is the case; otherwise, the contents may become corrupted.

  24. Save and close the parameter file. From this point forward, Oracle GoldenGate continues to synchronize data changes.