Sie sind auf Seite 1von 11

Configuring Change Delivery

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Objectives
After completing this lesson, you should be able to:
Explain what the Replicat process does
Configure and start a Replicat process
Configure Replicat to handle collisions between changes
and the initial-load data

8-2

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Step 4. Change Delivery


1. Preparing the environment
Source
Database
3. Initial load (various methods)

Target
DB
Data Pump

Extract
Transaction
Log

Local
Trail

Replicat
Remote
Trail

2. Change capture

8-3

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

4. Change delivery

Replicat Overview

The Replicat process runs on the target system.


Multiple Replicat processes can be used with multiple
Extract processes in parallel to increase throughput.
Replicat can:

8-4

Read data out of GoldenGate trails


Perform data filtering by table, row, or operation
Perform data transformation
Perform database operations just as your application
performed them

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Change Delivery Tasks


On the target system:
Create a checkpoint table in the target database (best
practice):
DBLOGIN
ADD CHECKPOINTTABLE

Create a parameter file for Replicat:


EDIT PARAMS

Create a Replicat group:


ADD REPLICAT

Start the Replicat process:


START REPLICAT

8-5

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Sample Configuration

Trail

Replicat

Target
DB

8-6

GGSCI> DBLOGIN USERID login PASSWORD pw


GGSCI> ADD CHECKPOINTTABLE checkpt
GGSCO> EDIT PARAMS REPORD
REPLICAT REPORD
USERID ggsuser PASSWORD ggspass
ASSUMETARGETDEFS
DISCARDFILE /ggs/dirrpt/REPORD.dsc, APPEND
MAP SALES.ORDERS, TARGET USSALES.USORDERS;
MAP SALES.INVENTORY, TARGET USSALES.USINVENTORY;

GGSCI> ADD REPLICAT REPORD, EXTTRAIL


/ggs/dirdat/rt
GGSCI> START REPLICAT REPORD

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Avoiding Collisions
with Initial Load

If the source database remains active during an initial load,


you must either avoid or handle any collisions when
updating the target with interim changes.
If you can back up, restore, or clone the database at a
point in time, you can avoid collisions by starting Replicat
to read trail records from a specific transaction commit
sequence number (CSN):
GGSCI> START REPLICAT <group> ATCSN | AFTERCSN <csn>

8-7

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Handling Collisions
with Initial Load

If you cannot avoid collisions, you must handle them.


The Replicat HANDLECOLLISIONS parameter can be
used.
When Replicat encounters a duplicate-record error on an
insert, it writes the change record over the initial data load
record.
When Replicat encounters a missing-record error for an
update or delete, the change record is discarded.

After all of the change data generated during the load has
been replicated, turn off HANDLECOLLISIONS:
GGSCI> SEND REPLICAT <group> NOHANDLECOLLISIONS
GGSCI> EDIT PARAMS <group> (to remove parameter)

8-8

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Discussion Questions
1. What does Replicat do?
2. When is ASSUMETARGETDEFS valid?
3. How does Replicat know the layout of the source tables
when source and target schemas differ?
4. What commands are used to create and start a Replicat
group?
5. What GGSCI command creates a GoldenGate checkpoint
table on the target database?
6. What is the purpose of the DISCARDFILE?
7. What parameter manages conflicts between initial load
and change replication? Where is it specified?

8-9

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Summary
In this lesson, you should have learned how to:
Explain what the Replicat process does
Configure and start a Replicat process
Configure Replicat to handle collisions between changes
and the initial load data

8 - 10

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Practices
The practices for this lesson cover the following topics:
Setting up the checkpoint table on the target system
Setting up GoldenGate delivery
Generating data and starting GoldenGate processes

8 - 11

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Das könnte Ihnen auch gefallen