Setting up a Replicat process
The Replicat processes are the delivery processes which are configured in the target environment. These processes read the changes from the trail files on the target system and apply them to the target database objects. If there are any transformations defined in the replicat configuration, the Replicat process takes care of those transformations as well. You can define the mapping information in the replicat configuration. The Replicat process will then apply the changes to the target database based on the mappings.
Getting ready
Before setting up replicat in the target system, you must have configured and started the Manager process.
How to do it…
Follow the following steps to configure a replicat in the target environment:
From the GoldenGate
Home
directory, run the GoldenGate software command line interface (GGSCI) as follows:./ggsci
Log in to the target database through GGSCI as shown in the following code:
GGSCI> DBLOGIN, USERID <USER> PASSWORD <PW>
Add the Checkpoint table as shown in the following code:
GGSCI> ADD CHECKPOINTTABLE <SCHEMA.TABLE>
Edit the Replicat process configuration as shown in the following code:
GGSCI> EDIT PARAMS RGGTEST1
This command will open an editor window. You need to add the replicat configuration parameters in this window as shown in the following code:
REPLICAT <REPLICAT_NAME> USERID <TARGET_GG_USER>@TARGETDB, PASSWORD ****** DISCARDFILE <DISCARDFILE_SPEC> MAP <mapping_specification>;
For example:
REPLICAT RGGTEST1 USERID GGATE_ADMIN@TGORTEST, PASSWORD ****** DISCARDFILE /u01/app/ggate/dirrpt/RGGTEST1.dsc, APPEND, MEGABYTES 500 MAP SCOTT.*, SCOTT.*;
Save the file and exit the editor.
Add the replicat to the GoldenGate instance as shown in the following code:
GGSCI> ADD REPLICAT <REPLICAT> EXTTRAIL <PATH>
For example:
ADD REPLICAT RGGTEST1, EXTTRAIL /u01/app/ggate/dirdat/rt
Start the Replicat process as shown in the following code:
GGSCI> START REPLICAT <REPLICAT>
How it works…
In the preceding procedure we first create a Checkpoint table in the target database. As the name suggests, the Replicat process uses this table to maintain its checkpoints. In case the Replicat process crashes and it is restarted, it can read this Checkpoint table and start applying the changes from the point where it left.
Once you have added a Checkpoint table, you need to create a parameter file for the Replicat process. Once the process parameter file is created, it is then added to the GoldenGate instance. At this point, we are ready to start the Replicat process and apply the changes to the target database. You should see an output similar to the following:
GGSCI (stdby1-ol6-112.localdomain) 10> start replicat RGGTEST1 Sending START request to MANAGER ... REPLICAT RGGTEST1 starting
You can check the status of the Replicat process using the following command:
GGSCI (stdby1-ol6-112.localdomain) 10> status replicat RGGTEST1 REPLICAT RGGTEST1: RUNNING
There's more…
Following are the common parameters that are specified in the replicat configuration:
DISCARDFILE
: This parameter is used to specify the name of the discard file. If the Replicat process is unable to apply any changes to the target database due to any errors, it writes the record to the discard file.EOFDELAY
secs
: This parameter controls how often GoldenGate should check the local trail file for new data.REPORTCOUNT
: This parameter controls how often the Replicat process writes its progress to the report file.BATCHSQL
: This parameter is used to specify theBATCHSQL
mode for replicat.ASSUMETARGETDEFS
: This parameter tells the Replicat process to assume that the source and target database object structures are the same.
See also
Read Setting up GoldenGate replication between tables with different structures using defgen recipe in Chapter 2, Setting Up GoldenGate Replication
Steps to configure a BATCHSQL mode recipe in Chapter 6, Monitoring, Tuning, and Troubleshooting GoldenGate for further information