18 Configuring Replicat
This chapter contains instructions for configuring the Replicat apply process to deliver data to a target PostgreSQL database.
Topics:
Parent topic: Using Oracle GoldenGate for PostgreSQL
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 and Coordinated.
For more information on the differences between types of Replicats, review the Creating an Online Replicat Group content in the Administering Oracle GoldenGate guide.
Parent topic: Configuring Replicat
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.
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.
Parent topic: About Replicat
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.
Parent topic: Configuring Replicat
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 a Coordinated Replicat.
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.
-
Using GGSCI, connect to the DSN for the target database.
GGSCI> DBLOGIN SOURCEDB dsn USERIDALIAS alias
-
Add the checkpoint table using the GGSCI command.
GGSCI> ADD CHECKPOINTTABLE ggadmin.oggcheck
Parent topic: Prerequisites for Creating a Replicat
Creating a Replicat
-
In GGSCI, 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 Replicat, the name must be five or less alpha-numeric characters in length. -
Enter the Replicat parameters in the order shown, starting a new line for each parameter statement.
Sample basic parameters for Classic Replicat:
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 Replicat. 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.
-
-
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. -
Save and close the file.
-
Add the Replicat, which in this example, will be a Coordinated Replicat.
GGSCI> ADD REPLICAT repnm, COORDINATED, EXTTRAIL ./dirdat/ep, CHECKPOINTTABLE ggadmin.oggcheck
-
Start the Replicat.
Parent topic: Configuring Replicat