You are on page 1of 28

Oracle GoldenGate 11g: Implementers Workshop

Oracle GoldenGate 11g: Implementers Workshop


Advanced Heterogeneous Database Replication, Operational Business
Intelligence and Data Warehouse, Business Continuity and Zero-Downtime
Migration and Upgrade
Workshop 2
Performing Initial Data Load Using
File to Replicat and Direct Load Methods

Workshop Developer: Fawzi A. Alswaimil


Contributors: Deema F. Alswaimil
Khaled K. Hawashin

Version: 1.2
Code:
ORA10001EN10
Advanced
Heterogeneous Database Replication, Operational Business Intelligence
Date:
16-Feb-2013
High-Availability
and Zero-Downtime Migration and Upgrade
Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-1

Oracle GoldenGate 11g: Implementers Workshop

1.0 An Overview
This hands-on workshop has been designed to give attendees best practices for
implementing Oracle GoldenGate 11g. The workshop walks you through the process to
install, configure and deploy Oracle GoldenGate 11g source and target instances. Then
perform business-specific implementation such as:

Oracle GoldenGate 11g for Report Offloading


Oracle GoldenGate 11g for Disaster Recovery
Oracle GoldenGate 11g for High-Availability
Oracle GoldenGate 11g for Zero-Downtime Migration and Upgrade
Oracle GoldenGate 11g for Operational Business Intelligence
Oracle GoldenGate 11g for Data Warehouse
Oracle GoldenGate 11g for Heterogeneous Replications
Oracle GoldenGate 11g for Data Guard Integration

From the ground-up, attendees learn where to download Oracle GoldenGate 11g Media
Pack, perform quick-install for Oracle GoldenGate 11g, Configure Data Capture, learn
and perform initial data load techniques, Configure Data transfer and Configure Data
Apply.
For users who need to apply Oracle GoldenGate 11g for specific business areas, the
workshop guide them in step-by-step approach to learn the details of configuring the
modular architecture to build flexible yet high-performance integrated systems for
Oracle-to-Oracle or Heterogeneous environment supporting in-house developed and
Package applications systems.
Packaged Applications Support

Oracle E-Business Suite


SAP R3
Oracle Siebel
Oracle JD Edward
Salesforce.com

Audience

IT Managers and Team-Leaders


Database Administrators
Data Warehouse Analysts
System Administrators
Network Administrators
Storage Administrators

Pre-Requisites

Familiarity with Oracle Basic Administrative commands


Familiarity with Basic SQL Data Manipulation Language (DML)
Understands Distributed database concept

Advanced Heterogeneous Database Replication, Operational Business Intelligence


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-2

Oracle GoldenGate 11g: Implementers Workshop

Objectives
By successfully completing the workshops, the attendees will be capable to work with
Oracle GoldenGate 11g and apply the learned best practices to their workplace. The
objective focus on major application of Oracle GoldenGate 11g to:

Understand Oracle GoldenGate 11g applications


Prepare and configure source and target database environments
Work with Oracle GoldenGate components
Configure Oracle GoldenGate 11g for Uni-Directional applications
Configure Oracle GoldenGate 11g for Bi-Directional applications
Configure Oracle GoldenGate 11g Advanced Replication
Configure Oracle GoldenGate 11g DDL Replication
Configure Oracle GoldenGate 11g for Heterogeneous Replication
Configure Oracle GoldenGate 11g Intermediate Systems
Configure Oracle GoldenGate 11g Integrated Capture
Configure Oracle GoldenGate 11g on Data Guard Environment
Configure and work with Oracle GoldenGate 11g Management Pack

The workshop follows several routes, each depends on the need of your organization.
Figure 1 shows the business objective and the recommended workshops to practice.
Additional workshops can be completed after running the cleanup procedure.

Fig.1: Workshop Routes


Advanced Heterogeneous Database Replication, Operational Business Intelligence
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-3

Oracle GoldenGate 11g: Implementers Workshop

Topics
Understand Oracle GoldenGate 11g application areas
Configuring Oracle GoldenGate 11g for Query and Report Offloading
Configuring Oracle GoldenGate 11g for Disaster Recovery Solutions
Configuring Oracle GoldenGate 11g for High-Availability Active-Passive
Configuring Oracle GoldenGate 11g for High-Availability Active-Active
Configuring Oracle GoldenGate 11g for Zero Downtime Upgrade and Migration
Configuring Oracle GoldenGate 11g for Operational BI and Data Warehouse
Configuring Oracle GoldenGate 11g for Heterogeneous Replication
Configuring Oracle GoldenGate 11g for Data Guard Integration
Review Understand Oracle GoldenGate 11g network topologies and Architecture
Un-Directional Configuration Query offloading
Bi-Directional Configuration for Standby Database and Active-Active for HA
Master-Master Configuration for Enterprise Load Balancing
Cascade using Intermediate Systems for Data Transformation
Broadcast Configuration for Data Distribution
Data Warehouse and Data mart Integration and consolidation configuration
Prepare Database Environment and Install Oracle GoldenGate 11g
Enable Database Supplemental Logging
Review Oracle GoldenGate 11g requirements for Operating System and Databases
Download and Install Oracle GoldenGate 11g
Working with GoldenGate 11g Software Command Interface (GGSCI)
Create Oracle GoldenGate 11g instance and directory structure
Configure the Source and Target Managers processes
Understand and configure Managers best-practice parameters
Login to Oracle Database using Oracle GoldenGate 11g
Run basic GGSCI commands
Create and Manage Checkpoint table
Working with TRANDATA command to enable Tables Supplemental Logging
Oracle GoldenGate 11g Initial Data Load Techniques
Work with Initial Data Load using File to Replicat method
Work with Initial Data Load using Direct load method
Understand Initial Data Load using Bulk-Direct load method
Understand Initial Data Load using Database Utility
Use handle collision for Initial Data Load Techniques
Control collision handling using SEND Command
Control Replicat for Initial Load and RBA handling
Oracle GoldenGate 11g: Uni-Directional Setup for Report Offloading
Configure, create and manage Primary Extract processes and local trails
Configure, create and manage Data Pump Extract process for routing to target
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process
Use administrative command to view process reports and troubleshooting
Understand Memory allocation by Oracle GoldenGate 11g
Advanced Heterogeneous Database Replication, Operational Business Intelligence
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-4

Oracle GoldenGate 11g: Implementers Workshop

Use Oracle GoldenGate 11g Uni-Directional for Report Offloading


Use Oracle Database 11g OLAP Materialized View with Oracle GoldenGate 11g
Enable and verify Report offloading on Oracle GoldenGate 11g target

Oracle GoldenGate 11g: Bi-Directional Setup for Business Continuity


Configure, create and manage Primary Extract processes and local trails
Configure, create and manage Data Pump Extract process
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process
Use administrative command to view process reports and troubleshooting
Detect and resolve conflict for Update and Delete DML operations
Understand and apply Oracle GoldenGate 11g Techniques to resolve conflicts
Develop stored procedure and SQL queries for managing and resolving conflicts
Oracle GoldenGate 11g Advanced Configuration and DDL Replication
Configure, create and manage Primary Extract processes and local trails
Configure, create and manage Data Pump Extract process for routing to target
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process
Use administrative command to view process reports and troubleshooting
Use COLSEXCEPT to exclude unsupported Data types
Use COLMAP feature for mismatched table structures
Use SQLEXEC to invoke PL/SQL Stored procedure
Use WHERE clause to implement row filtering
Use FILTER to apply complex row and column manipulations
Use Oracle GoldenGate 11g Build-In functions
Use DEFGEN Utility
Use RANGE Function to deploy Replicat parallelism
Perform basic and advanced DDL replications
Oracle GoldenGate 11g Intermediate System for Query Offloading
Configure, create and manage Primary Extract processes and local trails
Configure, create and manage Data Pump Extract process for Source System
Configure, create and manage Remote Trial Files for Source System
Configure, create and manage Data Pump Extract process for intermediate systems
Configure, create and manage Remote Trial Files for intermediate systems
Configure, create and manage Replicat processes
Use administrative command for reporting and troubleshooting
Understand Memory allocation by Oracle GoldenGate 11g
Use Oracle GoldenGate 11g Uni-Directional for Report Offloading
Use Oracle Database 11g OLAP Materialized View with Oracle GoldenGate 11g
Enable and verify Report offloading on Oracle GoldenGate 11g target
Oracle GoldenGate 11g Integrated Capture
Configure, create and manage Integrated Capture processes
Configure, create and manage Data Pump Extract process for routing to target
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process
Advanced Heterogeneous Database Replication, Operational Business Intelligence
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-5

Oracle GoldenGate 11g: Implementers Workshop

Use administrative command for reporting and troubleshooting

Oracle GoldenGate 11g Zero Downtime Migration and Upgrade


Configure, create and manage Source Extract process and local trails
Configure, create and manage Data Pump Extract process for routing to target
Configure, create and manage Remote Trial Files
Monitor Remote Trail Queue
Use RMAN to perform Database Cloning
Use RMAN to perform Migration to ASM
Use DBUA to perform upgrade from Oracle Database Release 10.2 to 11.2
Configure, create and manage Replicat process
Verify Source and Target Database are synchronized
Oracle GoldenGate 11g Heterogeneous Replication
Configure, create and manage Primary Extract processes and local trails for Oracle
Configure, create and manage Data Pump Extract process for routing to target
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process for MySQL
Verify and testing data replication
Use administrative command for reporting and troubleshooting
Oracle GoldenGate 11g Integration with Oracle Database 11g Data Guard
Configure Oracle Database 11g Data Guard
Configure, create and manage Primary Extract processes and local trails on Standby
Configure, create and manage Data Pump Extract process for routing to target on
Standby Database
Configure, create and manage Remote Trial Files
Configure, create and manage Replicat process
Use administrative command for reporting and troubleshooting
Oracle GoldenGate 11g Management Packs, Veridata
Understand Oracle GoldenGate 11g Veridata Architecture
Review Oracle GoldenGate 11g Veridata components
Oracle GoldenGate 11g Veridata Installation
Configuring GoldenGate 11g Veridata Java Agent
Using GoldenGate 11g Veridata Web-Interface
Perform Data verify and rectify operation
Running GoldenGate 11g Veridata Reports
Oracle GoldenGate 11g Management Packs, Director
Understand Oracle GoldenGate 11g Director
Understand Oracle GoldenGate 11g Director Installation
Configuring Oracle GoldenGate 11g Director Server
Using Oracle GoldenGate 11g Client Interface
Using Oracle GoldenGate 11g Director Web Interface
Oracle GoldenGate 11g Management Packs, Configuration Assistant
Understand Oracle GoldenGate 11g Configuration Assistant
Use Oracle GoldenGate 11g Configuration Assistant to verify environments
Advanced Heterogeneous Database Replication, Operational Business Intelligence
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-6

Oracle GoldenGate 11g: Implementers Workshop

Use Oracle GoldenGate 11g Configuration Assistant runtime options


Oracle GoldenGate 11g Configuration Assistant to review and verify design
Oracle GoldenGate 11g Configuration Assistant to deploy to Target Instance

Oracle GoldenGate 11g Optimization, Tuning and Troubleshooting


Implementing Compression, Encryption
Implementing GGSCI security
Working with Oracle GoldenGate 11g MACRO
Working with LOGDUMP Utility
Implement BATCHSQL feature for transaction optimization
Monitoring Lag and Statistics
Performance Tuning for Extract
Performance Tuning for Data Pump
Performance Tuning for Replicat
Oracle Database 11g: Data Guard Fundamentals
Understand Data Guard Standby Database
Configure and work with Data Guard Broker
Data Guard Architecture
Creating Physical Standby Database
Understand Protection levels
Work with Database Role Settings
Monitor Data Guard Trace capabilities
Understand Fast-Start Failover
Understand Startup and Shutdown processes
Apply best-practice Data Guard Configuration
Perform Database Switchover and Failover
Oracle Database 11g: Upgrade Fundamentals
Oracle Database 11g Upgrade Techniques
Oracle Database 11g Installation Workflow
Oracle Database 11g Upgrades road Map
Oracle Database 11g Upgrades Methods for Zero-Downtime
Pre-Upgrade Scripts and configuration
Pre-Upgrade Scripts report
Gathering Dictionary statistics
Oracle Database 11g Database Upgrade Assistant (DBUA)
Performing Oracle Database 11g Upgrade using DBUA GUI
Performing Oracle Database 11g Upgrade using DBUA Silent mode
Post-Upgrade configuration
Time Zone file Version and Time Zone package
Oracle Recovery Manager Catalog Upgrade

Advanced Heterogeneous Database Replication, Operational Business Intelligence


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-7

Oracle GoldenGate 11g: Implementers Workshop

2.0 Workshop 1 Database Environment


The workshop consists of 1 Source Oracle Database 10g Release 2 (Local) and 1
Target Oracle Database 11g Release 2 (Remote). Both Oracle Installations use Oracle
GoldenGate 11g.
2.1 Database Name: S1T2 (Source)
Object name
RDBMS Version
Oracle GoldenGate 11g
Global Database Name
SID
Oracle Home
Password for all accounts
Database File Directory
Flush Recovery Area
Character Set
National Character Set
Endian Format

Setting
10.2.0.5.0
11.1.1.1.2
S1T2.precisetrace.com
S1T2
/u01/app/oracle/product/10.2.0/db_1
Oracle
/u01/app/oracle/oradata/S1T2/
/u01/app/oracle/flash_recovery_area
AL32UTF8
AL16UTF16
Little

2.2 Database Name: T1E2 (Target)


Object name
RDBMS Version
Oracle GoldenGate 11g
Global Database Name
SID
Oracle Home
Password for all accounts
Database File Directory
Fast Recovery Area
Character Set
National Character Set
Endian Format

Setting
11.2.0.3.0
11.1.1.1.2
T1E2.precisetrace.com
T1E2
/u01/app/oracle/product/11.2.0/dbhome_1
oracle_4U
+DATA
+FRA
AL32UTF8
AL16UTF16
Little

2.3 ASM Instance: +ASM


Object name
Clusterware Version
Global Database Name
SID
Oracle Home
Password for all accounts
Data Disk Group (DG)
Fast Recovery Area DG
FRA Size
ASM Disks

Setting
11.2.0.3.0
+ASM.precisetrace.com
+ASM
/u01/app/oracle/product/11.2.0/grid
oracle_4U
+DATA (Norma)
+FRA (External)
44GB
/dev/x*

Advanced Heterogeneous Database Replication, Operational Business Intelligence


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-8

Oracle GoldenGate 11g: Implementers Workshop

2.4 Intermediate System


Object name
RDBMS Version
Oracle GoldenGate 11g
Oracle Home

Setting
11.2.0.3.0
11.1.1.1.2
/u01/app/oracle/product/11.2.0/dbhome_1

2.5 Workshop Environment and Credentials

2.6 ora.env Utility


$ ora.env arg1 arg2 arg3 arg4 arg5 [arg6][arg10]
Argument
arg1
arg2
arg3
arg4
arg5
arg6
arg7
arg8
arg9
arg10

Description
Oracle Database Version
Oracle Database Release
Oracle Database Update
Database Type: Source or Target
Source or Target number
DISPLAY
Program executable
Username
Password
Option

Example
10 or 11 only
1 or 2
1, 2, 3, 4 or 5
s, t or i
1, 2, 3, n-1, n
Localhost, Hostname or IP
sqlplus, rman, lsnrctl, gaskin, etc
System
Oracle
Connect string, target, local, etc.

$ora.env 10 2 0 s 1 localhost sqlplus

Advanced Heterogeneous Database Replication, Operational Business Intelligence


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-9

Oracle GoldenGate 11g: Implementers Workshop

3.0 Workload Simulator for Online System Monitor (OSM) Database


Testing Oracle GoldenGate 11g transactions handling from the source Database to the
target Database for one way, or from the Target Database to the Source for Two-Way is
done by a PL/SQL Application Programmatic Interface (API) called TRANS_LOAD.
3.1 How to use TRANS_LOAD Simulator?
TRNAS_LOAD API simulates Small-Medium-Large (S-M-L) Workload for CUSTOMERSPOLICIES Database. TRANS_LOAD can be invoked for different S-M-L workloads;
examples of the options available are described in the table below.
EXEC Call Command option
BEGIN
TRANS_LOAD(1, 100001);
END;
BEGIN
FOR i IN 100002..100012 LOOP
TRANS_LOAD(1, i);
END LOOP;
End;
BEGIN
FOR i IN 100013..100113 LOOP
TRANS_LOAD(1, i);
DBMS_LOCK.SLEEP(2);
END LOOP;
END;

Description
Insert one row only starting at row
100001.
Insert 10 rows starting at row
100002.

Insert 100 rows starting at row


100013, with sleep option of 2
seconds between each 2 rows.

The Database table structure described below.


S1T2>DESC osm$repapi.customers
Name
Null?
Type
---------------------------- ------------------CUST_NO
NOT NULL NUMBER
CUST_NAME
NOT NULL VARCHAR2(128)
CUST_EMAIL
NOT NULL VARCHAR2(128)
CUST_MOBILE
NOT NULL VARCHAR2(16)
CUST_ADDRESS
VARCHAR2(128)
S1T2>DESC osm$repapi.policies
Name
Null?
Type
---------------------------- ------------POL_NO
NOT NULL NUMBER
POL_FROM
NOT NULL DATE
POL_TO
NOT NULL DATE
POL_VALUE
NOT NULL NUMBER(8,2)
POL_SUB_TOTAL
NOT NULL NUMBER(8,2)
PT_CODE
NOT NULL VARCHAR2(8)
DT_CODE
VARCHAR2(8)
POL_TOTAL
NOT NULL NUMBER(8,2)
CUST_NO
NOT NULL NUMBER
Advanced Heterogeneous Database Replication, Operational Business Intelligence
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-10

Oracle GoldenGate 11g: Implementers Workshop

4.0 Preparation of Oracle GoldenGate 11g Initial Load


The diagram illustrates the
workshop workflow. The
major tasks are:

Workshop 2: File-To-Replicat Initial Load

Initial Data load Extract


Initial Data load Replicat
Verify initial Data Load

Perform Initial Load


Extract

Initload.dat

The initial data load


Extract (ELOAD01) reads
from the source tables and
create Extract file on the
Target Server.

Extract File

Initial Load Data


File

The initial data load


Replicat (RLOAD01)
applies the data to the
Target Database. Extract
data can be on one or
more files.

4.1 Objectives

After completing this workshop lab, you will be able to:

4.2 Lab Setup

Perform Initial Load


Replicat
2

Create the Source and Target Oracle GoldenGate 11g Global


parameter file.
Create the Source and Target Oracle GoldenGate 11g
Checkpoint table.
Configure, start and verify successful Oracle GoldenGate 11g
Manager for Source and Target.
Prepare, configure and perform initial data load Extract from
the source table using File-to-Replicat method.
Prepare, configure and perform initial data load Replicat from
the Data file.

This lab requires that your environment has the following


Configuration

Oracle Database 10g EE Release 10.2.0.5.0


Oracle Database 11g Grid Infrastructure Release 11.2.0.3.0
Oracle Database 11g EE Release 11.2.0.3.0
Source Database: S1T2
Source Instance: S1T2
Source Global Database: S1T2.precisetrace.com
Network configuration files already setup for S1T2 and T1E2

Advanced Heterogeneous Database Replication, Operational Business Intelligence


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2012, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-11

Oracle GoldenGate 11g: Implementers Workshop

5.0 Workshop Tasks


After successful completion of Workshop 1, in this exercise, you will use Oracle
GoldenGate 11g to perform initial data load from Source to Target Database. The
exercise to transport the Database for CUSTOMERS-POLICIES from the source tables
to the target already created tables.
Duration: 90 Minutes

Scenario
You are assigned the task to configure Oracle GoldenGate 11g for the Source database
(S1T2) running on Oracle Database 10g EE Version 10.2.0.5.0 to T1E2, and the Target
Database (T1E2) running on Oracle Database 11g EE Version 11.2.0.3.0.
This is Workshop 2 of 5 to perform Oracle Database 11g: Zero-Downtime Migration and
Upgrade.

Tasks Summary
No

Tasks

Step/Instructions

Create the GLOBALS parameter


file for Source
Create the checkpoint table on
the Source
Create the GLOBALS parameter
file for Target
Create the checkpoint table on
the Target
Prepare, start and verify the
manager process for Source
Prepare, start and verify the
manager process for Target
Prepare and Start the initial Data
load Extract
Verify successful initial data load
for Source Table
Prepare, add and start Replicat
Process on Target
Verify the Replicat Process
completion Report
Verify the Database row count
matching for Source and Target

Step 1

Step 2

Step 3

Step 4

Step 5 and Step 6

Step 7 and Step 8

Step 9 and Step 10

Step 11

Step 12 and Step 13

Step 14

Step 15

2
3
4
5
6
7
8
9
10
11

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

Completed/Note

2-12

Oracle GoldenGate 11g: Implementers Workshop

Step 1: Prepare the GLOBALS parameter files on Source


Use GGSCI to create the
GLOBALS parameter file.
The GLOBALS parameters
file applies to Oracle
GoldenGate 11g instance
globally.
The location of the
GLOBALS parameter file is
the Oracle GoldenGate
11g home. For UNIX/Linux
its case sensitive and
must be in Upper case.

GLOBALS
Parameters File

The GLOBALS parameters are used by all GoldenGate 11g


Extracts, Data Pumps Extract and Replicats processes. The
steps to create the GLOBALS parameter files are listed below:

Start Oracle GoldenGate 11g GGSCI


Invoke the EDIT command
GGSCI>edit params ./GLOBALS

Add the checkpoint table parameter


checkpointtable ogg_admin.ggschkpt

Requirement

You must exist GGSCI, re-start GGSCI to read the GLOBALS


parameter file. If you encounter an error, use the operating
system editor to correct the error, and then start GGSCI.
Two options are available to create the checkpoint table:
1. Use the checkpointtable parameter for GLOBALS
parameter file.
2. Specify the checkpoint table parameter part of the add
checkpointtable command.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-13

Oracle GoldenGate 11g: Implementers Workshop

Step 2: Create the Checkpoint Table on Source


The checkpoint table
provides more flexibility
than using dirchk file.
Because the workshop
designed for BiDirectional configuration,
the checkpoint table will
be created for the Source
and Target Databases.
The command requires
login to the Database
from Oracle GoldenGate
11g instance. The table
resides on the default
tablespace of ogg_admin
user.
Login to SQL*Plus to
verify the table by
performing DESC
command.

Checkpoint Table

File-based Checkpointing is used to record the write and read


positions of Extract, Data Pump Extract and Replicat, providing
resilience against failures. For Replicat, its best-practice to use
Database Table for Checkpointing.
GGSCI (edm6hp99.precisetrace.com) 1>dblogin userid ogg_admin,
password oracle
Successfully logged into database.
GGSCI (edm6hp99.precisetrace.com) 2>add checkpointtable
No checkpoint table specified, using GLOBALS specification
(ogg_admin.ggschkpt)...
Successfully created checkpoint table OGG_ADMIN.GGSCHKPT.
GGSCI (edm6hp99.precisetrace.com) 3>

The checkpoint table name is subject to the standard Oracle


Database table naming. Most importantly, you should avoid
Oracle Database reserved words and Oracle GoldenGate 11g
commands.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-14

Oracle GoldenGate 11g: Implementers Workshop

Step 3: Prepare the GLOBALS parameter files on Target


Use GGSCI to create the
GLOBALS parameter file.
The GLOBALS parameters
file applies to Oracle
GoldenGate 11g instance
globally.
The location of the
GLOBALS parameter file is
the Oracle GoldenGate
11g home. For UNIX/Linux
its case sensitive and
must be in Upper case.

GLOBALS
Parameters File

The GLOBALS parameters are used by all GoldenGate 11g


Extracts, Data Pumps Extract and Replicats processes. The
steps to create the GLOBALS parameter files are listed below:

Start Oracle GoldenGate 11g GGSCI


Invoke the EDIT command
GGSCI>edit params ./GLOBALS

Add the checkpoint table parameter


checkpointtable ogg_admin.ggschkpt

Requirement

You must exist GGSCI, re-start GGSCI to read the GLOBALS


parameter file. If you encounter an error, use the operating
system editor to correct the error, and then start GGSCI.
Two options are available to create the checkpoint table:
3. Use the checkpointtable parameter for GLOBALS
parameter file.
4. Specify the checkpoint table parameter part of the add
checkpointtable command.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-15

Oracle GoldenGate 11g: Implementers Workshop

Step 4: Create the Checkpoint Table on Target


The checkpoint table
provides more flexibility
than using dirchk file.
Because the workshop
designed for BiDirectional configuration,
the checkpoint table will
be created for the Source
and Target Databases.
The command requires
login to the Database
from Oracle GoldenGate
11g instance. The table
resides on the default
tablespace of ogg_admin
user.
Login to SQL*Plus to
verify the table by
performing DESC
command.

Checkpoint Table

Checkpoint table is used to record the write and read positions of


Extract, Data Pump Extract and Replicat, avoiding re-performing
capture and replicat.
GGSCI (edm6hp99.precisetrace.com) 1>dblogin userid ogg_admin,
password oracle
Successfully logged into database.
GGSCI (edm6hp99.precisetrace.com) 2>add checkpointtable
No checkpoint table specified, using GLOBALS specification
(ogg_admin.ggschkpt)...
Successfully created checkpoint table OGG_ADMIN.GGSCHKPT.
GGSCI (edm6hp99.precisetrace.com) 3>

Note

If the table already exists, an error message is displayed. From


SQL*Plus verify the existence of the checkpoint table.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-16

Oracle GoldenGate 11g: Implementers Workshop

Step 5: Prepare the Manager Process Parameter File (mgr.prm) on Source


The Manager Process is
the first Oracle
GoldenGate 11g to be
created. The only
required parameter is the
PORT used by the
manager process and
defined on mgr.prm
parameter file.
Before continuing the
creation of other Oracle
GoldenGate 11g
processes, ensure the
manager process is on
RUNNING status.
If not, reviews the file
report file dirrpt/mgr.rpt
for details about the error
when trying to start it.

Manager Process

The manager process is a required Oracle GoldenGate 11g


process that must be running for other processes to function
normally.
GGSCI (edm6hp99.precisetrace.com) 1>edit params mgr
port 7810
dynamicportlist 9001-9100
purgeoldextracts ./dirdat/*, &
usecheckpoints, &
minkeephours 0

The Manager process is responsible for the following functions:

Monitor the health of Oracle GoldenGate 11g instance


Control activities such as starting and restring processes
Report error of the instance
Allocating of space

The manager processes has the status of:

STOPPED
RUNNING

The character & allows multi-line sub-parameters.


Advanced Heterogeneous Database Replication, Operational Business Intelligence,
High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-17

Oracle GoldenGate 11g: Implementers Workshop

Step 6: Start the Manager Process on Source and verify Status


Save the manager process
parameter file (mgr.prm),
ensure its saved on the
directory
dirprm/mgr.prm.
Also, investigate the
manager process report
file from dirrpt/mgr.prt
ensuring there no
indication of incorrect
configuration; also correct
any INFO warning, if
possible.
Even though the
configuration can be
directly done from the
editor, it preferably done
using GGSCI, ensuring the
correct location.

Online Status
Report

You have two option to display the manager status report, which
very necessary to confirm before proceeding further Extract and
Replicat configurations.
GGSCI (edm6r1s30.precisetrace.com) 1>start mgr
Manager started.
GGSCI (edm6r1s30.precisetrace.com) 2>info mgr
Manager is running (IP port edm6r1s30.precisetrace.com.7810).
GGSCI (edm6r1s30.precisetrace.com) 3>info all
Program
Chkpt

Status

MANAGER

RUNNING

Group

Lag

Time Since

GGSCI (edm6r1s30.precisetrace.com) 4>

Ensure the correct IP port number, which is 7810 for the Source
and 7811 for the Target.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-18

Oracle GoldenGate 11g: Implementers Workshop

Step 7: Prepare the Manager Process Parameter File (mgr.prm) on Target


The Manager Process is
the first Oracle
GoldenGate 11g to be
created. The only
required parameter is the
PORT used by the
manager process and
defined on mgr.prm
parameter file.
Before continuing the
creation of other Oracle
GoldenGate 11g
processes, ensure the
manager process is on
RUNNING status.
If not, reviews the file
report file dirrpt/mgr.rpt
for details about the error
when trying to start it.

Manager Process

The manager process is required Oracle GoldenGate 11g


process that must be running for other processes to function
normally.
GGSCI (edm6hp99.precisetrace.com) 1>edit params mgr
port 7811
dynamicportlist 9001-9100
purgeoldextracts ./dirdat/*, &
usecheckpoints, &
minkeephours 0

The Manager process is responsible for the following functions:

Monitor the health of Oracle GoldenGate 11g instance


Control activities such as starting and restring processes
Report error of the instance
Allocating of space

The manager processes has the status of:

STOPPED
RUNNING

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-19

Oracle GoldenGate 11g: Implementers Workshop

Step 8: Start the Manager Process on Target and verify Status


Save the manager process
parameter file (mgr.prm),
ensure its saved on the
directory
dirprm/mgr.prm.
Also, investigate the
manager process report
file from dirrpt/mgr.prt
ensuring there no
indication of incorrect
configuration; also correct
any INFO warning, if
possible.
Even though the
configuration can be
directly done from the
editor, it preferably done
using GGSCI, ensuring the
correct location.

Online Status
Report

You have two option to display the manager status report, which
very necessary to confirm before proceeding further Extract and
Replicat configurations.
GGSCI (edm6r1s30.precisetrace.com) 1>start mgr
Manager started.
GGSCI (edm6r1s30.precisetrace.com) 2>info mgr
Manager is running (IP port edm6r1s30.precisetrace.com.7811).
GGSCI (edm6r1s30.precisetrace.com) 3>info all
Program
Chkpt

Status

MANAGER

RUNNING

Group

Lag

Time Since

GGSCI (edm6r1s30.precisetrace.com) 4>

Ensure the correct IP Port number, which is 7810 for the Source
and 7811 for the Target.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-20

Oracle GoldenGate 11g: Implementers Workshop

Step 9: Prepare ELOAD01 Extract Parameter file (eload01.prm) on Source


Several methods are
available to perform the
initial load from the
Source Database to the
Target Database, the
methods require creating
the schema definition
before the initial load
starts.
The File to Replicat
method requires the
tables are created, to
avoid massive collision,
ensure the table has no
data. Up on completion,
verify the data from SQL
by comparing the row
count from both the
Source and the Target.

ELOAD01 Extract

Initial load File to Replicat configuration read the tables directly


from the Source Database, indicated by the soruceistable
parameter.
GGSCI (edm6hp99.precisetrace.com) 1>edit params eload01
sourceistable
userid ogg_admin, password oracle
rmthost localhost, mgrport 7811
rmtfile ./dirdat/initload01.dat, purge
table osm$repapi.customers;
table osm$repapi.policies;

The initial data load file is created on the Target Server using the
parameters rmthost and rmtfile which refer to:

Target host name


Target manager port
Target initial data file location and name

The rmtfile purge option removes an existing initial load file,


avoiding failure of the extract command.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-21

Oracle GoldenGate 11g: Implementers Workshop

Step 10: Perform initial Extract from Source Tables


The initial load File to
Replicat will be executed
from the Operating
System using the Oracle
GoldenGate 11g extract
command.
The initial load Extract
Process (ELOAD01) will
run for the duration of the
extract and will terminate
up on completion.
Depending on the amount
of Source data, it will take
a while for the Extract
command to complete, as
this method extracting
row-by-row and writing
remotely.

ELOAD01 Extract

The extract command for File to Replicat method is executed


from the Operating System using the command extract.
The extract command takes the following parameters:

The Extract parameter name


The Extract report file name (Log file)

S1T2@edm6hp99.precisetrace.com$ pwd
/u01/app/ogg/10.2.0
S1T2@edm6hp99.precisetrace.com$ extract paramfile
dirprm/eload01.prm reportfile dirrpt/eload01.rpt
S1T2@edm6hp99.precisetrace.com$

Note

Because the default location of the file eload01.prm is dirprm


directory, and the Extract command is started from Oracle
GoldenGate 11g home, the paramfile argument take the value
dirprm/elaod01.prm
The parameter paramfile can be used as pf, and
reportfile as rf.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-22

Oracle GoldenGate 11g: Implementers Workshop

Step 11: Verify Replicat data File and View Extract Report
After successful
completion of the initial
load, verify the data file
location on the Target
Oracle GoldenGate 11g.
The location should is
configured using the
parameter rmtfile on the
Source Extract parameter
file.
If the file does not exist,
then the initial load had
failed and must be re-run.
Before re-running the
extract command,
investigate the report file,
correct the issue and then
re-run the command.

Verify Initial Load


Data File

The initial load creates the data file on the Target server. This
will be used by the Replicat to load data into the Database.
GGSCI (edm6hp99.precisetrace.com) 2> exit
S1T2@edm6hp99.precisetrace.com$ pwd
/u01/app/ogg/10.2.0
S1T2@edm6hp99.precisetrace.com$ cd ../11.2.0/dirdat
S1T2@edm6hp99.precisetrace.com$ ls -al
total 37148
drwxrwxr-x 2 oracle oinstall
4096 May 21 19:11 .
drwxrwxr-x 15 oracle oinstall
4096 May 21 18:33 ..
-rw-rw-rw- 1 oracle oinstall 37986149 May 21 19:11
initload01.dat
S1T2@edm6hp99.precisetrace.com$

The size of the data file depends on the amount of tables data.
The table should not be compressed, and if its, then table
compressing need to be disabled before performing initial load
extract.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-23

Oracle GoldenGate 11g: Implementers Workshop

View Report (Source) GGSCI (edm6r1s30.precisetrace.com) 3>view report


dirrpt/eload01.rpt

***************************************************
Oracle GoldenGate Capture for Oracle
Version 11.1.1.1.2
OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Linux, x86, 32bit (optimized), Oracle 10g on Oct 7
2011 14:35:40
Copyright (C) 1995, 2011, Oracle and/or its
affiliates. All rights reserved.
Starting at 2012-05-21 19:11:29
***************************************************
Operating System Version:
Linux
Version #1 SMP Thu Sep 3 02:28:20 EDT 2009, Release
2.6.18-164.el5PAE
Node: edm6hp99.precisetrace.com
Machine: i686
soft limit
hard limit
Address Space Size
:
unlimited
unlimited
Heap Size
:
unlimited
unlimited
File Size
:
unlimited
unlimited
CPU Time
:
unlimited
unlimited

Process id: 5472


Report at 2012-05-21 19:11:38 (activity since 201205-21 19:11:29)
Output to ./dirdat/initload01.dat:
From Table OSM$REPAPI.CUSTOMERS:
#
inserts:
#
updates:
#
deletes:
#
discards:
From Table OSM$REPAPI.POLICIES:
#
inserts:
#
updates:
#
deletes:
#
discards:
REDO Log Statistics
Bytes parsed
Bytes output

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

100000
0
0
0
100000
0
0
0

0
37985196

2-24

Oracle GoldenGate 11g: Implementers Workshop

Step 12: Prepare RLOAD01 Replicat parameter file (rload01.prm) on Target


Performing File to
Replicat requires the
configuration of Targets
Replicat as special run
process.
Use Oracle GoldenGate
11g EDIT command to
prepare the Replicat
(RLOAD01), which will
read the initial file to load
into the Target Database.
Before starting the
Replicat process, the ADD
RELICAT command is used
to add the Replicat
RLOAD01 to Oracle
GoldenGate 11g instance.

RLOAD01 Replicat

After moving the data from the Source Database to the Target
Server, its now ready for upload into the Target Database. To
avoid termination of process due to collision, ensure the
parameter handlecollisions is included in the parameter
file rload01.rpm.
GGSCI (edm6hp99.precisetrace.com) 1>edit params rload01
replicat rload01
specialrun
assumetargetdefs
handlecollisions
userid ogg_admin, password oracle
extfile ./dirdat/initload01.dat
discardfile ./dirrpt/rload01.dsc, purge
map osm$repapi.*, target osm$repapi.*;
end runtime

After successful run of the initial load Replicat, the process will
automatically terminate with status STOPPED.
To avoid future start of this Replict unintentionally, its
recommended to delete this Replicat from the configuration.
Delete the Replicat requires login to the Database from Oracle
GoldenGate 11g.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-25

Oracle GoldenGate 11g: Implementers Workshop

Step 13: Add and Start Initial Load Replicat Process on Target
The initial to Replicat load
method requires adding
the Replicat process to
Oracle GoldenGate 11g
instance.
Because its a special run
process, do no start and
the status should be on
STOPPED status.
From the Operating
System, run the command
replicat. The process will
be started, and after the
load on the Target
Database is completed, it
will remain on STOPPED
status, and should be
deleted.

ADD REPLICAT
Command

Execute the ADD REPLICAT command. Then exit and run the
replicat process from the Operating System.
GGSCI (edm6hp99.precisetrace.com) 2>add replicat rload01,
extfile ./dirdat/initload01.dat
REPLICAT added.
GGSCI (edm6hp99.precisetrace.com) 3> info all
Program
Chkpt

Status

Group

Lag

Time Since

MANAGER
REPLICAT

RUNNING
STOPPED

RLOAD01

00:00:00

00:00:04

GGSCI (edm6hp99.precisetrace.com) 4> exit


T1E2@edm6hp99.precisetrace.com$
/u01/app/ogg/11.2.0/dirdat
T1E2@edm6hp99.precisetrace.com$
T1E2@edm6hp99.precisetrace.com$
/u01/app/ogg/11.2.0
T1E2@edm6hp99.precisetrace.com$
rf dirrpt/rload01.rpt

pwd
cd ..
pwd
replicat pf dirprm/rload01.prm

T1E2@edm6hp99.precisetrace.com$

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-26

Oracle GoldenGate 11g: Implementers Workshop

Step 14: View Report and Verify initial Data load


After the loading of data
by the Replicat, ensure
the data moved
successfully.
This should be done by
viewing the Replicat
report, and the Database
utility such as SQL*Plus.
If you find any failure,
investigate the report and
discard files. The report
display the number of row
inserted for each table.
Only insert will performed
during initial load, and
zero for update and
delete transactions.

View Report

Reading ./dirdat/initload01.dat, current RBA


37986149, 200000 records
Report at 2012-05-21 19:36:51 (activity since 201205-21 19:35:20)
From Table OSM$REPAPI.CUSTOMERS to
OSM$REPAPI.CUSTOMERS:
#
inserts:
#
updates:
#
deletes:
#
discards:
From Table OSM$REPAPI.POLICIES to
OSM$REPAPI.POLICIES:
#
inserts:
#
updates:
#
deletes:
#
discards:

100000
0
0
0
100000
0
0
0

Last log location read:


FILE:
./dirdat/initload01.dat
RBA:
37986149
TIMESTAMP: 2012-05-21 19:11:36.367903
EOF:
NO
READERR:
400

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-27

Oracle GoldenGate 11g: Implementers Workshop

Step 15: Confirm the Target Database


Login to the Target
Database using SQL*Plus,
return the number of
rows for the mapped
tables.
The initial data load is
completed; the next
workshop is to configure
the Capture Data Change
(CDC).
Workshop 3 is the UniDirectional configuration
is one way configuration
with a Data Pump Extract
option.
Workshop 4 extends the
configuration to BiDirectional configuration.

SQL*Plus

$ ora.env 11 2 0 t 1 localhost sqlplus osm$repapi oracle


local
T1E2>select count(*)
2
from
customers;
COUNT(*)
---------100000
T1E2>select count(*)
2
from
policies;
COUNT(*)
---------100000
T1E2>

If the result in not 100,000 then there was collision and the
discard file should be reviewed. For best practice, before
starting the Replicat process, disable DDL replication, disable
constraint, and use wild-card if necessary instead of the table
names. If the source Database is active, then an Extract
process should be configured and started before the initial load.

Advanced Heterogeneous Database Replication, Operational Business Intelligence,


High-Availability and Zero-Downtime Migration and Upgrade

Copyrights 2013, PreciseTrace, Inc. | www.precisetrace.com/ebcc

2-28

You might also like