NYOUG-Oracle GoldenGate Technical Deep Dive Dec2016
NYOUG-Oracle GoldenGate Technical Deep Dive Dec2016
Patterns 1
Y V RAVI KUMAR
Oracle Certified Master (OCM) – May 2009
Oracle ACE – May 2015
Oracle ACE Spotlight for the month - Jun 2016
ABOUT ME
“Community Expert” in DELL’s Toad World
“Expert” in Oracle Technology Network (OTN) community
CO-FOUNDER OF
Patterns 2
ORACLE GOLDENGATE 11g/12c
Introduction
Patterns 3
Quick History In Replication
Oracle Advance
Change Data Capture (CDC) Oracle Streams Oracle GoldenGate
Replication
• Synchronous
• Asynchronous
• Multi-Master Replication
• MV Replication
• Capture Messages
• Staging Messages
• Consumption
• Heterogeneous
• Multiple Architectures
• Multiple Use Cases
Patterns 4
Database Replication Options
Data Guard
Active Data Guard
InfoSphere Change
Data Capture for
Oracle Replication
Patterns 5
INTRODUCTION
Oracle Golden Gate enables the exchange and manipulation of data at the
transaction level among multiple, heterogeneous platforms across the
enterprise.
Oracle Golden Gate moves committed transactions from redo logs and maintains
transaction integrity with sub-second latency
Patterns 6
Oracle GoldenGate – Supported Platforms
Patterns 7
ORACLE GOLDENGATE
Topologies
Patterns 8
ORACLE GOLDENGATE TOPOLOGIES
Patterns 9
ORACLE GOLDEN GATE TOPOLOGIES
CASCADING DATAMARTS
Patterns 10
ORACLE GOLDEN GATE TOPOLOGIES
BIDIRECTIONAL STANDBY
UNIDIRECTIONAL QUERY DB OR ACTIVE-ACTIVE FOR PEER-TO-PEER LOAD
OFFLOADING HIGH-AVAILABILITY BALANCING,
MULTIMASTER
INTEGRATION / CONSOLIDATION
BROADCAST DATA
DATA WAREHOUSE CASCADING MARTS
DISTRIBUTION
Patterns 11
ORACLE GOLDENGATE 12c
STANDBY
(OPEN & HIGH AVAILABILITY
ACTIVE)
REPORTING
ORACLE DATABASE
LIVE REPORTING
GOLDEN
GATE
ODS . ETL EDW .
OPERATIONAL
BUSINESS
INTELLIGENCE
ETL
EDW .
ETL
ETL TRANSACTIONAL
DATA INTEGRATION
MESSAGE BUS ETL
Patterns 12
Benefits Of Oracle GoldenGate
High Availability (Standby Database)
Load balancing
Application Specific HA
Patterns 13
Benefits Of Oracle GoldenGate
Patterns 14
Oracle Golden Gate Solutions for Oracle Database
Patterns 15
Oracle GoldenGate Solutions for Oracle Database
Patterns 16
ORACLE GOLDENGATE
Components and Architecture
Patterns 17
ORACLE GOLDEN GATE LOGICAL ARCHITECTURE
INITIAL LOAD
DATA SOURCE EXTRACT REPLICAT
FOR INITIAL
LOAD: SOURCE
TABLES
NETWORK
MANAGER
MANAGER
DATA SOURCE
CHANGE EXTRACT COLLECTOR
SYNCHRONIZA REPLICAT
-TION:
TRANSACTION
LOG TRAIL OR FILE
(OPTIONAL)
Patterns 18
Oracle GoldenGate 12c – Source and Target
SERVER: Golden Gate 1 (Source)
Reads
redo log
Files
Trail
log
files files
for HR schema
Writes to
GoldenGate collectors
data pump
process
GoldenGate
SCHEMAS
SYS GoldenGate
Data Pump
Changes written to
GoldenGate Collector
writes
HR Replicat (RPHR01) process
HR Schema process
Trail files
Reads Trail grow until Writes to
Files data Trail Files
DATABASE: ORACLE processed
Patterns 19
Oracle GoldenGate 12c – Source and Target
SERVER: GoldenGate 1 (Source)
Extract
DATABASE: ORACLE GoldenGate
Trail Files
AP HR
GoldenGate Writes
Writes
SCHEMAS
SYS GoldenGate
GoldenGate writes
Changes written to Collector
HR Replicat (RPHR01) process
HR Schema process
Trail files
Reads Trail grow Writes to
Files until Trail Files
DATABASE: ORACLE data
processed
Patterns 20
Oracle GoldenGate 12c – Source and Target
SERVER: Golden Gate 1 (Source)
Reads
redo log
Files
Trail
log
files files
for HR schema
Writes to
GoldenGate collectors
data pump
process
GoldenGate
SCHEMAS
SYS GoldenGate
Data Pump
Changes written to
GoldenGate Collector
writes
HR Replicat (RPHR01) process
HR Schema process
Trail files
Reads Trail grow until Writes to
Files data Trail Files
DATABASE: ORACLE processed
Patterns 21
Checkpoints
Patterns 22
CHECKPOINTS - CAPTURE
Start of Oldest
BEGIN : TX1
Open (Uncommited) _________
Transaction _________ CAPTURE
INSERT : TX1 _________
_________
_________
CHECK
BEGIN : TX2
______
POINT
INSERT : TX2
COMMIT : TX2
BEGIN : TX3
INSERT : TX3
BEGIN : TX4
COMMIT : TX3
DELETE : TX4
CAPTURE CHECKPOINT
Patterns 23
CHECKPOINTS - CAPTURE - PUMP
_________
_________ PUMP BEGIN : TX2
_________
_________
_________
CHECK INSERT : TX2
______
POINT
COMMIT : TX2
INSERT : TX3
COMMIT : TX3
PUMP CHECKPOINT
Patterns 24
CHECKPOINTS - CAPTURE - PUMP - DELIVERY
_________
_________
_________
PUMP
_________
_________
CHECK
______
POINT
DELIVERY
TARGET DATABASE
DELIVERY CHECKPOINT
Patterns 25
CHECKPOINTS - CAPTURE - PUMP - DELIVERY
Patterns 26
ELIMINATE DOWN-TIME DURING ORACLE DATABASE UPGRADES
REAL-TIME UPDATES
CAPTURE DELIVERY
ORACLE ORACLE
8i / 9i / 10g 11g
Route (LAN/WAN/Web/IP)
CAPTURE
DELIVERY POST-SWITCHOVER
DATA FLOW
Patterns 27
ELIMINATE UNPLANNED DOWN-TIME WITH ACTIVE DATA GUARD
REAL-TIME UPDATES
CAPTURE DELIVERY
Patterns 28
IMPROVE PRODUCTION SYSTEM PERFORMANCE & LOWER COSTS
QUERY OFFLOADING
TRANSACTION
READ-ONLY
PROCESSING
ACTIVITY
ACTIVITY
APPLICATION
REAL-TIME UPDATES
CAPTURE DELIVERY
Route (LAN/WAN/Web/IP)
ORACLE REPLICA
LEGACY PRODUCTION
OLTP
Patterns 29
ORACLE GOLDENGATE FOR OPERATIONAL REPORTING
OPERATIONAL REPORTING
OLTP REPORTING
APPLICATION APPLICATION
Sddsgsdggdsgfsfsf Sddsgsdggdsgfsfsf
ddsjg ddsjg
dggdgjkddgdkjddd dggdgjkddgdkjddd
n dnjnd dsgnjn
sdgnjngj
ngjndjdnsg
jdjnjdsg njn dnj
REAL-TIME UPDATES n dnjnd dsgnjn
sdgnjngj
ngjndjdnsg
jdjnjdsg njn dnj
djgn jnjgnjdg d djgn jnjgnjdg d
Dgjdjgjk d jsdgbjj Dgjdjgjk d jsdgbjj
sdj jbdsg jbsdg sdj jbdsg jbsdg
jbdsg sbdgbsdjb jbdsg sbdgbsdjb
bsdg jsdbgsdgb bsdg jsdbgsdgb
bkbgdg bkbgdg
DELIVERY
kjbdgjkbgsjk
CAPTURE
kjbdgjkbgsjk
dbgjbg jksg jbjdjdj dbgjbg jksg jbjdjdj
TRAIL FILE
CAPTURE Route (LAN/WAN/Web/IP) TRAIL FILE
DELIVERY
Route (LAN/WAN/Web/IP)
REPORTING
PRODUCTION INSTANCE
DATABASE
Patterns 30
INCREASE ROI ON EXISTING SERVERS & SYNCHRONIZE GLOBAL DATA
ACTIVE - ACTIVE
APPLICATION APPLICATION
REAL-TIME UPDATES
DELIVERY
CAPTURE
DELIVERY CAPTURE
Route (LAN/WAN/Web/IP)
SOURCE & TARGET DB SOURCE & TARGET DB
Patterns 31
ORACLE GOLDENGATE – THE WAY IT WORKS
Extract
Committed transactions are captured (and can be filtered) as they occur by reading the transaction logs.
CAPTURE
PUMP
TRAIL FILES
PUMP
TRAIL FILES
PUMP TRAIL FILES
TRAIL FILES
Patterns 33
UPDATE DISASTER RECOVERY SITE – IN ONE OPERATION
Patterns 34
MANAGE MANY DATABASES AS ONE
ONE STANDBY DATABASE COVERS ALL PLUGABLE DATABASES
Patterns 35
ORACLE GOLDENGATE
Performance Tuning
Patterns 36
Extract Flavours
Integrated Extract
Is an Oracle GoldenGate Extract for Oracle databases (Database Release 11.2.0.3 and later)
Is multithreaded & Supports more data types
Relies on Oracle’s internal log parsing and processing implementation
Supports downstream topologies
Is new with version 11.2.1.0.0
Works with Logminer
Register Extract (capture) with database/logminer required
Example: GGSCI> register extract [ name ] database container [ (PDB) ]
Classic Extract
Is traditional REDO log-based extract for Oracle
Works for all DB platforms and versions
Patterns 37
DDL Setup Scripts – Source and Target
Classic Extract
Oracle Database 11.2.0.3.0 Or earlier, or are running classic mode then the scripts need to be run from SQL *Plus as sysdba
Scripts to be executed
@marker_setup.sql
@ddl_setup.sql
@role_setup.sql
Grant role to user
@ddl_enable.sql
DDL Trigger must be enabled
Integrated Extract
No need to run the scripts
Requires Oracle Database 11.2.0.4.0 or later
DDL Trigger must be disabled for Integrated mode DDL replication
Patterns 38
Identify Extract – Classic OR Integrated
Patterns 39
Oracle GoldenGate Performance Areas
Trail Trail
Capture Pump
Files Files Delivery
GoldenGate
GG tools: LAG, REPORTCOUNT GoldenGate
Patterns 40
Install the UTL_SPADV Package (Integrated Extract and Integrated Replicat)
UTL_SPADV PL/SQL package provides subprograms to collect and analyze statistics for the LogMiner server processes.
The statistics help identify any current areas of contention such as CPU or I/O.
Oracle Streams Performance Advisor (SPADV) enables monitoring of the integrated GoldenGate server
processes which are used by integrated Extract and integrated Replicat, and provides information about how these
processes are performing.
SPADV statistics are collected and analyzed using the UTL_SPADV package.
UTL_SPADV package, as the Oracle GoldenGate administrator user on the source database.
a. Grant the following privileges to a designated Oracle GoldenGate administrator database user:
SQL> exec DBMS_GOLDENGATE_AUTH.GRANT_ADMIN_PRIVILEGE( -
'<db user name>');
b. Connect to the database with the user name that was granted permissions in Step a.
Patterns 41
Gather Statistics using the UTL_SPADV Package
Oracle recommends that you gather statistics for a 30-60 minute time period during which you are troubleshooting performance.
It is also recommended to gather statistics during a 30-60 minute time period where performance is good, serving as a baseline comparison.
To gather statistics every 15 seconds, run the following SQL*Plus command as the Oracle GoldenGate
administrator:
SQL> exec UTL_SPADV.START_MONITORING(interval=>15);
Run the following commands to determine if the monitoring job is currently running:
SET SERVEROUTPUT ON
DECLARE
is_mon BOOLEAN;
BEGIN
is_mon := UTL_SPADV.IS_MONITORING(
job_name => 'STREAMS$_MONITORING_JOB',
client_name => NULL);
IF is_mon=TRUE THEN
DBMS_OUTPUT.PUT_LINE('The monitoring job is running.');
ELSE
DBMS_OUTPUT.PUT_LINE('No monitoring job was found.');
END IF;
END;
/
Patterns 42
Generating Report - UTL_SPADV Package
It is also possible to create a static report of SPADV statistics after monitoring for a period of time. The report can be
generated in text form much like the display of real-time statistics.
To generate a text report, from SQL*Plus as the Oracle GoldenGate administrator, execute the following:
spool /tmp/spadv.txt
begin
utl_spadv.show_stats(path_stat_table=>'STREAMS$_PA_SHOW_PATH_STAT',
bgn_run_id=> 1,
end_run_id=> 9999,
show_legend=> TRUE);
end;
After the reports have been generated, Oracle recommends purging the SPADV statistics using the
following
command:
Patterns 43
Identifying the Bottlenecks
LAN /
EXTRACT WAN REPLICAT
INTERNET
MANAGER MANAGER ▲
If the (latency) in
REPLICAT is acceptable
then All is Well
●●●●● ●●●●● ●●●●●
Throughput
If the lag in Statistics are also
If the lag useful in identifying potential bottlenecks
If the lag in
← Monitoring
EXTRACT, Start Lag – Working
in PUMP,from the Target back to the REPLICAT,
Source check
Here! check for for Lag in PUMP
Lag in
EXTRACT
Patterns 44
Q&A
yenugulavenkata.ravikumar
@yvrk1973
http://yvrk1973.blogspot.in
http://in.linkedin.com/pub/yv-ravikumar-oracle-certified-master-ocm/14/13/a50
Patterns 45