Posted by: michaelverzijl | 10/11/2011

GoldenGate Monitor – Create Solutions

Afther the installation and configuration, it’s time to add a solution.

What is a solution?
A solution is a complete mapping from source to target. In this example we will configure:

  • Extract
  • Datapump
  • Replicat

First of all we need to create a table and a sequence:

CREATE TABLE GG_TABLE
(
  ID          NUMBER,
  DT_CREATED  DATE,
  COLUMN1     VARCHAR2(100 BYTE),
  COLUMN2     NUMBER(9),
  COLUMN3     DATE
)
LOGGING
NOCOMPRESS
NOCACHE
NOPARALLEL
MONITORING;


CREATE UNIQUE INDEX TABLE_PK ON GG_TABLE
(ID)
LOGGING
NOPARALLEL;


ALTER TABLE GG_TABLE ADD (
  CONSTRAINT TABLE_PK
 PRIMARY KEY
 (ID));

CREATE SEQUENCE GG_TABLE_SEQ
  START WITH 1
  MAXVALUE 9999999999999999999999999999
  MINVALUE 0
  NOCYCLE
  NOCACHE
  NOORDER;

This script is executed on Source and Target.

Add trandata
You need to enable supplemental logging on the table before you start the GoldenGate process:

GGSCI> dblogin userid gg11, password <PASSWORD>
Successfully logged into database.
GGSCI> add trandata GG11_USER.*
Logging of supplemental redo data enabled for table GG11_USER.GG_TABLE.

Configure Extract
The first step in the process is to configure the extract process:

GGSCI> edit params xsource

extract xsource
-- Database connection user
userid gg11, password <PASSWORD>
-- Discared records endup in this file 
discardfile ./dirrpt/gg11.dsc, purge 
-- Extract report settings
reportcount every 30 minutes, rate 
-- Specify the local exttrail to write to 
exttrail ./dirdat/x1
-- Specify schemas from which sequnces will be replicated
sequence GG11_USER.*
-- Specify schema from which tables will be replicated 
table GG11_USER.*;

And add the extract:

GGSCI> add extract xsource, tranlog, begin now

Create the exttail:

GGSCI>  add exttrail ./dirdat/x1 extract xsource

Configure Datapump
Datapump will provide a process to transfer the files from source to target

GGSCI> edit params dpsource

extract dpsource
passthru
rmthost 192.168.1.50, mgrport 7809
rmttrail ./dirdat/x1
-- Specify schemas from which sequnces will be replicated
sequence GG11_USER.*
-- Specify schema from which tables will be replicated 
table GG11_USER.*;

And add the datapump:

GGSCI> add extract dpsource, exttrailsource ./dirdat/x1

Create the rmttrail

GGSCI>  add rmttrail ./dirdat/x1, extract dpsource, megabytes 100

Start the GoldenGate instance
On the source all processes are configured and ready to start.

GGSCI> start manager

Manager started.

Once you logged in to the Monitor you will see:

The monitor process is running, all other processes aren’t started yet (so no info available)
Let’s start the extract process:

GGSCI>start extract xsource


Sending START request to MANAGER ...
EXTRACT XSOURCE starting

Wait a few moments and refresh the monitor page:

If you click on the Capture process you will see more details:

Start datapump

GGSCI>start extract dpsource

Sending START request to MANAGER ...
EXTRACT DPSOURCE starting

Refresh the monitor and you will see the start of this process:

Complete solution
If you look at the complete solution you are missing the target:

Target
Well let’s start by starting the manager on the target:

GGSCI> start manager

Manager started.

Once the manager is started and registered with Monitor the picture changes:

Configure replicat
Now let’s configure the replicat process:

GGSCI> edit params rtarget


replicat rtarget
userid gg11, password <PASSWORD>
-- Replicate table truncates
gettruncates
-- Discared records endup in this file
discardfile ./dirrpt/rtarget.dsc, purge
assumetargetdefs
map GG11_USER.*, target GG11_USER.*;

Now add the replicat proces to GoldenGate:

GGSCI> add replicat rtarget, exttrail ./dirdat/x1
REPLICAT added.

Start replicat

GGSCI>  start replicat rtarget

Once again see Monitor for the new Overview:

Also a solution has been created:

This solution can be opened:

Notice that the LAG is 0.00 seconds (no transactions processed yet)

Start some inserts

With a short script we insert some rows on the source:

insert into GG_TABLE
(id
,dt_created
,column1
,column2
,column3
)
select GG_TABLE_SEQ.nextval
,      sysdate
,      object_type
,      namespace
,      created
from   dba_objects
;

commit;

Now 79.303 rows are created and commited

Monitor shows you the progress:

On the historical data you can see the historical data:

Next step is adding users!

Advertisements

Responses

  1. […] https://mverzijl.wordpress.com/2011/11/10/goldengate-monitor-create-solutions-2/ […]

  2. Hi Michael – nice post. I have added a link to this page from my website as well. KInd regards – Gavin

    • Thanks Gavin!
      When I was looking for an introduction on GG, I often used your site!

  3. Cant see any solutions and have put up two full source – staging – target combinations. Any ideas would be very welcome.

    • Which steps did you follow in configuring GG Monitor?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Categories

%d bloggers like this: