官术网_书友最值得收藏!

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:

  1. From the GoldenGate Home directory, run the GoldenGate software command line interface (GGSCI) as follows:
    ./ggsci
    
  2. Log in to the target database through GGSCI as shown in the following code:
    GGSCI> DBLOGIN, USERID <USER> PASSWORD <PW>
    
  3. Add the Checkpoint table as shown in the following code:
    GGSCI> ADD CHECKPOINTTABLE <SCHEMA.TABLE>
    
  4. Edit the Replicat process configuration as shown in the following code:
    GGSCI> EDIT PARAMS RGGTEST1
    
  5. 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.*;
    
  6. Save the file and exit the editor.
  7. 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
    
  8. 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 the BATCHSQL 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
主站蜘蛛池模板: 邮箱| 原阳县| 白银市| 马公市| 湘潭市| 揭西县| 朝阳区| 繁峙县| 汉寿县| 天峻县| 壶关县| 海宁市| 连城县| 丁青县| 临泽县| 盐津县| 象州县| 简阳市| 马关县| 嘉鱼县| 遵化市| 河间市| 米林县| 嘉黎县| 县级市| 武夷山市| 登封市| 锡林浩特市| 马鞍山市| 宿州市| 乌审旗| 曲水县| 金门县| 贡嘎县| 南昌县| 泰顺县| 高雄市| 莲花县| 谢通门县| 南通市| 平南县|