13 Creating Process Groups

This chapter contains instructions for creating Oracle GoldenGate process groups, collectively known as the "change-synchronization" processes. At minimum, you will create one primary Extract, one data pump, and one Replicat process group.

Topics:

13.1 Prerequisites

This chapter assumes you have installed Oracle GoldenGate, understand the different processing options available to you, and have performed the following prerequisite configuration steps before proceeding to configure Oracle GoldenGate process groups.

13.2 Registering Extract with the Mining Database

If you are using Extract in integrated mode, you need to create a database logmining server to capture redo data. You do this from the GGSCI interface by registering the primary Extract process with the mining database.

The creation of the logmining server extracts a snapshot of the source database in the redo stream of the source database. In a source multitenant container database, you register Extract with each of the pluggable databases that you want to include for capture.

WARNING:

Make certain that you know the earliest SCN of the log stream at which you want Extract to begin processing. Extract cannot have a starting SCN value that is lower than the first SCN that is specified when the underlying database capture process is created with the REGISTER EXTRACT command. You can use the SCN option

  1. Log into the mining database then use the commands appropriate to your environment. The use of DBLOGIN always refers to the source database.

    Command for source database deployment:

    DBLOGIN USERIDALIAS alias
    

    Command for downstream mining database deployment:

    DBLOGIN USERIDALIAS alias
    MININGDBLOGIN USERIDALIAS alias2
    

    Where: alias specifies the alias of the database login credential that is assigned to Extract. This credential must exist in the Oracle GoldenGate credential store. For more information, see Establishing Oracle GoldenGate Credentials. For more information about DBLOGIN, see Reference for Oracle GoldenGate. For more information about MININGDBLOGIN, see Reference for Oracle GoldenGate.

  2. Register the Extract process with the mining database.
    REGISTER EXTRACT group DATABASE [CONTAINER (container[, ...])] [SCN system_change_number]
    

    Where:

    • group is the name of the Extract group.

    • CONTAINER (container[, ...]) specifies a pluggable database (PDB) within a multitenant container database, or a list of PDBs separated with commas. The specified PDBs must exist before the REGISTER command is executed. Extract will capture only from the PDBs that are listed in this command. For example, the following command registers PDBs mypdb1 and mypdb4. Changes from any other PDBs in the multitenant container database are ignored by Oracle GoldenGate.

      REGISTER EXTRACT myextract DATABASE CONTAINER (mypdb1, mypdb4, mydb5)
      

      You can add or drop pluggable databases at a later date by stopping Extract, issuing a DBLOGIN command, and then issuing REGISTER EXTRACT with the {ADD | DROP} CONTAINER option of DATABASE. See Reference for Oracle GoldenGate for more information about REGISTER EXTRACT.

      Note:

      Adding CONTAINERs at particular SCN on an existing Extract is not supported.

    • Registers Extract to begin capture at a specific SCN in the past. Without this option, capture begins from the time that REGISTER EXTRACT is issued. The specified SCN must correspond to the begin SCN of a dictionary build operation in a log file. You can issue the following query to find all valid SCN values:

      SELECT first_change#
         FROM v$archived_log 
         WHERE dictionary_begin = 'YES' AND 
            standby_dest = 'NO' AND
            name IS NOT NULL AND 
            status = 'A';
      
  3. To register additional Extracts with a downstream database for the same source database, issue this REGISTER command.

    If you want to have more than one extract per source database, you can do that using the SHARE with REGISTER EXTRACT for better performance and metadata management. The specified SCN must correspond to the SCN where mining should begin in the archive logs.

    REGISTER EXTRACT group DATABASE [CONTAINER (container[, ...])] [SCN system_change_number] SHARE
    

Note:

The register process may take a few to several minutes to complete, even though the REGISTER command returns immediately.

13.3 Add the Primary Extract

The primary Extract writes to a trail.

These steps add the primary Extract that captures change data.

  1. If using downstream capture, set the RMAN archive log deletion policy to the following value in the source database:
    CONFIGURE ARCHIVELOG DELETION POLICY TO APPLIED ON ALL STANDBY
    

    This must be done before you add the primary Extract.

  2. Run GGSCI.
  3. If using integrated capture, issue the DBLOGIN command.
    DBLOGIN USERIDALIAS alias
    

    Where: alias specifies the alias of the database login credential that is assigned to Extract. This credential must exist in the Oracle GoldenGate credential store.

  4. Issue the ADD EXTRACT command to add the primary Extract group.
    ADD EXTRACT group name 
    {, TRANLOG | , INTEGRATED TRANLOG}
    {, BEGIN {NOW | yyyy-mm-dd[ hh:mi:[ss[.cccccc]]]} | SCN value} 
    [, THREADS n]
     
    

    Where:

    • group name is the name of the Extract group.

    • TRANLOG specifies the transaction log as the data source; for classic capture only. See Example 13-1.

    • INTEGRATED TRANLOG specifies that Extract receives logical change records through a database logmining server; for integrated capture only. See Example 13-2. Before issuing ADD EXTRACT with this option, make certain you logged in to the database with the DBLOGIN command and that you registered this Extract with the database. See Registering Extract with the Mining Database for more information.

    • BEGIN specifies to begin capturing data as of a specific time:

      • NOW starts at the first record that is time stamped at the same time that ADD EXTRACT is issued.

      • yyyy-mm-dd[ hh:mi:[ss[.cccccc]]] starts at an explicit timestamp. Logs from this timestamp must be available. For Extract in integrated mode, the timestamp value must be greater than the timestamp at which the Extract was registered with the database.

      • SCN value starts Extract at the transaction in the redo log that has the specified Oracle system change number (SCN). For Extract in integrated mode, the SCN value must be greater than the SCN at which the Extract was registered with the database. See Registering Extract with the Mining Database for more information.

    • THREADS n is required in classic capture mode for Oracle Real Application Cluster (RAC), to specify the number of redo log threads being used by the cluster. Extract reads and coordinates each thread to maintain transactional consistency. Not required for integrated capture.

    Note:

    Additional options are available. See Reference for Oracle GoldenGate.

Example 13-1 Classic capture with timestamp start point

ADD EXTRACT finance, TRANLOG, BEGIN 2011-01-01 12:00:00.000000

Example 13-2 Integrated capture with timestamp start point

DBLOGIN USERIDALIAS myalias
ADD EXTRACT finance, INTEGRATED TRANLOG, BEGIN NOW

13.4 Add the Local Trail

These steps add the local trail to which the primary Extract writes captured data.

In GGSCI on the source system, issue the ADD EXTTRAIL command:

ADD EXTTRAIL pathname, EXTRACT group name

Where:

  • EXTTRAIL specifies that the trail is to be created on the local system.

  • pathname is the relative or fully qualified name of the trail, including the two-character name.

  • EXTRACT group name is the name of the primary Extract group.

Note:

Oracle GoldenGate creates this trail automatically during processing.

Example 13-3

ADD EXTTRAIL /ggs/dirdat/lt, EXTRACT finance

13.5 Add the Data Pump Extract Group

These steps add the data pump that reads the local trail and sends the data to the target.

In GGSCI on the source system, issue the ADD EXTRACT command.

ADD EXTRACT group name, EXTTRAILSOURCE trail name 

Where:

  • group name is the name of the Extract group.

  • EXTTRAILSOURCE trail name is the relative or fully qualified name of the local trail.

Example 13-4

ADD EXTRACT financep, EXTTRAILSOURCE c:\ggs\dirdat\lt

13.6 Add the Remote Trail

Although it is read by Replicat, this trail must be associated with the data pump, so it must be added on the source system, not the target.

These steps add the remote trail:

In GGSCI on the source system, issue the following command:

ADD RMTTRAIL pathname, EXTRACT group name

Where:

  • RMTTRAIL specifies that the trail is to be created on the target system.

  • pathname is the relative or fully qualified name of the trail, including the two-character name.

  • EXTRACT group name is the name of the data-pump Extract group.

Note:

Oracle GoldenGate creates this trail automatically during processing.

Example 13-5

ADD RMTTRAIL /ggs/dirdat/rt, EXTRACT financep

13.7 Add the Replicat Group

These steps add the Replicat group that reads the remote trail and applies the data changes to the target Oracle Database.

  1. Run GGSCI on the target system.
  2. If using integrated Replicat, issue the DBLOGIN command to log into the database from GGSCI.
    DBLOGIN USERIDALIAS alias
    

    Where: alias specifies the alias of the database login credential that is assigned to Replicat. This credential must exist in the Oracle GoldenGate credential store. For more information, see Establishing Oracle GoldenGate Credentials

  3. Issue the ADD REPLICAT command with the following syntax.
    ADD REPLICAT group name, [INTEGRATED,] EXTTRAIL pathname
    

    Where:

    • group name is the name of the Replicat group.

    • INTEGRATED creates an integrated Replicat group.

    • EXTTRAIL pathname is the relative or fully qualified name of the remote trail, including the two-character name.

      For more information, see Reference for Oracle GoldenGate.

Example 13-6 Adds a Nonintegrated Replicat

ADD REPLICAT financer, EXTTRAIL c:\ggs\dirdat\rt

Example 13-7 Adds an Integrated Replicat

ADD REPLICAT financer, INTEGRATED, EXTTRAIL c:\ggs\dirdat\rt