Classical Extract Process

GOLDENGATE TUTORIAL

Classical Extract Process

The Goldenagte Extract process captures committed transactions from the Oracle Redo Logs or the Archived Logs. The Extract process writes the captured source data into a file known an EXTTRAIL file. The extract process uses the checkpoints to mark the read and write positions to track the location up to which the data has been extracted at any given time. This information is used to determine the starting point in case of a failure.

Configure Goldengate Extract Process

Extract Parameter File
The ESRC01.prm parameter file is used to create the extract process and is stored in the $GG_HOME/dirprm directory. The GG_HOME is the home directory where GoldenGate binaries are installed and dirprm was created in the pre-requisites phase by issuing “CREATE SUBDIRS”.

EXTRACT ESRC01
USERID OGG_USER PASSWORD OGG_USER
EXTTRAIL ./dirdat/st
TRANLOGOPTIONS EXCLUDEUSER OGG_USER
TRANLOGOPTIONS DBLOGREADER
TRANLOGOPTIONS BUFSIZE 4096000
TRANLOGOPTIONS DBLOGREADERBUFSIZE 4096000
TABLE APP_TEST.*;


The parameters used in the extract prm file are briefly explained below.

PARAMETER DESCRIPTION
EXTRACT Extract process name
USERID Database username for GoldenGate
EXTTRAIL Name of the extract file to be created
TRANLOGOPTIONS Specific directives while mining transactions
DBLOGREADER New ASM API to extract data
BUFSIZE Max bytes of memory allocated to read redo data – Increases Capture Speed
DBLOGREADERBUFSIZE Increases Maximum read size for ASM
TABLE Specify the SCHEMA and TABLE to extract data for


Adding Extract Process
Add the extract to Goldengate and attach a trailfile directory and the trail name to it. At the ggsci prompt run the commands. Make sure to connect to the database.
ggsci>DBLOGIN USERID OGG_USER PASSWORD OGG_USER
ggsci>ADD EXTRACT ESRC01, TRANLOG, BEGIN NOW
ggsci>ADD EXTTRAIL ./dirdat/st, EXTRACT ESRC01, megabytes 50

Here “st” is the starting 2 characters of the name of the Exttrail file to be created. Only a maximum of two characters can be specified. “MEGABYTES 50” is the maximum size of the exttrail.

Starting Extract
After adding the extract process, start the extract process. While the process is being added tail(look) the output in the ggserror.log to nsure no errors are written to it.

ggsci> start ESRC01


Here “ESRC01” is the name of the extract.

Status of Extract
In “ggsci” type the below command to check the status of the Golden gate extract process.

ggsci> info ESRC01
ggsci> view report ESRC01
ggsci> stats extract ESRC01


This command shows the display the status, row counts and details of data processed by the extract process.

View Trailfile
Go to the dirdat directory which was specified in the extract parameter file. You should see the trail file growing in size as extracted data is extracted from the redo logs and written there.

ls -lrt dirdat/st*

Stopping Extract
Run the command below to stop the extract process.
ggsci> stop ESRC01


Delete Extract
In case the Extract process needs to be deleted, you can run the “DELETE EXTRACT ..” to remove the extract process. However before you can delete the processes make sure that you connect to the database to remove the process entry from the database.

ggsci>DBLOGIN USERID OGG_USER PASSWORD OGG_USER
ggsci> DELETE EXTRACT ESRC01

Monitoring and Alerting EXTRACT process

After starting the EXTRACT process you can place the alerting to make sure you know if the process goes down. Simply place script in the crontab or another scheduler to be executed at the interval that best fits your needs.

GoldenGate Alerting and Monitoring Script

Oracle GoldenGate: Best Practices and Security

When setting up the Extract additional configuration can be performed to secure the GoldenGate replication environment. Read more on some of the options that should be implemented.

Oracle GoldenGate: Best Practices and Security

Simple Replication Series

GoldenGate Replication Pre-requisites
GoldenGate Manager
GoldenGate Classical Extract
GoldenGate Pump
GoldenGate Replicat
Uni-directional Replication Summary