20 Configuring Replicat

This chapter contains instructions for configuring the Replicat apply process to deliver data to a target PostgreSQL database.

Topics:

About Replicat

The Oracle GoldenGate Replicat for PostgreSQL reads data from Oracle GoldenGate source trail files and delivers the data to a target PostgreSQL database. The source trail data can be from any database that Oracle GoldenGate capture supports.

Available Replicats for PostgreSQL are Classic, Coordinated, and Parallel Replicat.

For more information on the differences between types of Replicats, review the Creating an Online Replicat Group content in the Administering Oracle GoldenGate guide.

Replicat Deployment Options

  • Local deployment: For a local deployment, the target database and Oracle GoldenGate are installed on the same server. No extra consideration is needed for local deployments.

  • Remote deployment: For a remote deployment, the target database and Oracle GoldenGate are installed on separate servers. Remote deployments are the only option available for supporting cloud databases, such as Azure for PostgreSQL or Amazon Aurora PostgreSQL.

    For remote deployments, operating system endianness between the database server and Oracle GoldenGate server needs to be the same, such as Windows and Windows, Linux and Linux, or Windows and Linux.

    With remote deployments, low network latency is important, and it is recommended that the network latency between the Oracle GoldenGate server and the target database server be less than 1 millisecond.

Prerequisites for Creating a Replicat

Review the Installing the DataDirect driver for PostgreSQL in Installing Oracle GoldenGate and ensure that the DataDirect drivers are installed correctly, which varies depending on the operating system.

Ensure that the PostgreSQL Client Authentication Configuration file, $PGDATA/pg_hba.conf, on the database server is configured to allow connections from the Oracle GoldenGate server, if installed remotely. See https://www.postgresql.org/docs/13/auth-pg-hba-conf.html for more information.

Creating a Checkpoint Table

A checkpoint table is used by a Replicat in the target database for recovery positioning when restarting a Replicat. A checkpoint table is optional (but recommended) for a Classic Replicat and required for Coordinated and Parallel Replicats.

The checkpoint table needs to be created under an existing schema in the database and by default will attempt to create the table in the schema listed in the GLOBALS file, GGSCHEMA parameter. Ensure that the schema listed in GLOBALS exists in the database and that the Replicat user has permissions to use the schema and create tables in it. When creating a Microservices deployment, the schema that is bound to the GLOBALS file is the one entered in the Replication Settings step when creating the deployment.

These steps demonstrate creating a checkpoint table for a Classic and Coordinated Replicat. The checkpoint table for a Parallel Replicat is created when adding the Replicat and does not need to be created in advance.

Microservices Architecture
  1. Using the Admin Client, connect to the deployment, then connect to the credential alias for the target database.
    OGG> CONNECT https://remotehost:srvmgrport DEPLOYMENT deployment_name AS deployment_user PASSWORD deployment_password
    
    OGG (https://remotehost:16000 postgresql_target)> DBLOGIN USERIDALIAS alias
  2. Add the checkpoint table:
    OGG (https:// remotehost:16000postgresql_target)> ADD CHECKPOINTTABLE
        ggadmin.oggcheck

    You can also add a checkpoint table from the Oracle GoldenGate MA Web UI. See Before Creating Replicat in the Step by Step Data Replication Using Oracle GoldenGate Microservices guide.

Classic Architecture
  1. Using GGSCI, connect to the DSN for the target database.
    GGSCI> DBLOGIN SOURCEDB dsn USERIDALIAS alias
  2. Add the checkpoint table using the GGSCI command.
    GGSCI> ADD CHECKPOINTTABLE ggadmin.oggcheck

Creating a Replicat

These steps create a Replicat to deliver transactional data to a target PostgreSQL database.
  1. In GGSCI, Admin Client, or REST API client on the target system, create the Replicat parameter file.
    EDIT PARAMS repnm
    In this sample, repnm is a name of the Replicat. For classic Replicat, the name can be no more than 8 alpha-numeric characters in length. For Coordinated and Parallel Replicats, the name must be five or less alpha-numeric characters in length.

    Note:

    To learn about using Oracle GoldenGate Microservices to perform this task, see How to Add a Replicat in the Step by Step Data Replication Using Oracle GoldenGate Microservices guide.
  2. Enter the Replicat parameters in the order shown, starting a new line for each parameter statement.

    Sample basic parameters for classic Replicat and parallel Replicats:

    REPLICAT repnm
    TARGETDB dsn_name USERIDALIAS alias
    BATCHSQL
    GETTRUNCATES
    MAP schema.object, TARGET schema.object;
    Sample basic parameters for Coordinated Replicat:
    REPLICAT repnm
    TARGETDB dsn_name USERIDALIAS alias
    BATCHSQL
    GETTRUNCATES
    MAP schema.object1, TARGET schema.object1, THREAD (1);
    MAP schema.object2, TARGET schema.object2, THREAD (2);
    MAP schema.object3, TARGET schema.object3, THREAD (3);
    Parameter Description

    REPLICAT repnm

    repnm is the name of the Replicat and cannot be more than 8 alpha-numeric characters in length for Classic Replicat and 5 or less for Coordinated and Parallel Replicats. For more information, see REPLICAT in Reference for Oracle GoldenGate.

    TARGETDB dsn_name

    Specifies the name of the database connection DSN.

    USERIDALIAS alias

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

    BATCHSQL

    GETTRUNCATES

    Optional parameters for Replicat that supports transaction batching and replication of truncate operations.

    MAP schema.object, TARGET schema.object;

    or

    MAP schema.*, TARGET schema.*;

    Specifies the relationship between a source table and the corresponding target object or objects.
    • MAP specifies the source table or a wildcarded set of tables.

    • TARGET specifies the target table or a wildcarded set of tables.

    • schema is the schema name or a wildcarded set of schemas.

    • object is the name of a table or a wildcarded set of tables.

    • THREAD assigns table operations to a specific coordinated Replicat thread.Terminate the parameter statement with a semi-colon.

      To exclude objects from a wildcard specification, use the MAPEXCLUDE parameter.

      For more information and for additional options that control data filtering, mapping, and manipulation, see MAP in Reference for Oracle GoldenGate.

  3. Enter any optional Replicat parameters that are recommended for your configuration. You can edit this file at any point before starting processing by using the EDIT PARAMS command.

  4. Save and close the file.

  5. Add the Replicat, which in this example, will be a Parallel Replicat.

    For Microservices Architecture using Admin Client:
    OGG (https://remotehost:16000postgresql_target)> ADD REPLICAT repnm, PARALLEL, EXTTRAIL ep, CHECKPOINTTABLE
    ggadmin.oggcheck
    For Classic Architecture using GGSCI:
    GGSCI> ADD REPLICAT repnm, PARALLEL, EXTTRAIL ./dirdat/ep, CHECKPOINTTABLE ggadmin.oggcheck
  6. Start the Replicat.