aioug ha day oct2015 goldengate- high availability day 2015

46
1 Patterns Oracle GoldenGate Technical Deep Dive PRESENTER Y V RaviKumar Oracle ACE & Oracle Certified Master (OCM) Head-Database Practices, Patterns 11th Oct 2015 Hyderabad

Upload: aioughydchapter

Post on 15-Jan-2017

412 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Aioug ha day oct2015 goldengate- High Availability Day 2015

1Patterns

Oracle GoldenGate Technical Deep Dive

PRESENTER

Y V RaviKumarOracle ACE & Oracle Certified Master (OCM)Head-Database Practices, Patterns

11th Oct 2015Hyderabad

Page 2: Aioug ha day oct2015 goldengate- High Availability Day 2015

2Patterns

AB

OU

T M

E

ORACLE CERTIFIED MASTER (OCM)http://education.oracle.com/education/otn/10g_OCM_17_Jun_11/ykumar.htm

ORACLE ACEhttps://apex.oracle.com/pls/apex/f?p=19297:4:::NO:4:P4_ID:13023

AUTHOR OF ORACLE TECHNOLOGY NETWORK (OTN) ARTICLEShttp://www.oracle.com/tecchnetwork/es/articles/index.html - (17 Articles for OTN Spanish)http://www.oracle.com/tecchnetwork/pt/articles/index.html - (14 Articles for OTN Portuguese)http://www.oracle.com/tecchnetwork/articles/index.html - - ( 2 Articles for OTN English)

ORACLE TECHNOLOGY SPEAKER @USER GROUPSSpeaker @Sangam Y2014Speaker @Independent Oracle User Group (IOUG) Y2014Speaker @Oracle Technology Network (OTN) Yathra Y2013, Y2014 & Y2015Speaker @All India Oracle User Group (AIOUG) Tech Day Y2013 & Y2014Speaker @All India Oracle User Group (AIOUG) ExadataSIG Y2014

AUTHOR OF TOAD WORLD (CONNECTED INTELLIGENCE)https://www.toadworld.com

Author Of OTech Magazinehttp://otechmag.com/magazine/2015/summer/ravikumar-yv.html

Author Of All things ORACLE from redgatehttp://allthingsoracle.com/upgrading-a-database-using-recovery-manager-rman-duplicate-command-in-oracle-12c/

CO-FOUNDER OF http://www.oraworld-team.com/

ORACLE CERTIFICATIONSOracle Database 10g: Certified Master (10g OCM)Oracle Database 10g & 11g: Administering RAC Certified ExpertOracle Database 11g: Performance Tuning Certified ExpertOracle Exadata 11g EssentialsOracle Golden Gate 10 EssentialsOracle Database 11g: SQL Tuning Certified ExpertOracle 9i & 10g: Managing Oracle on Linux Certified ExpertOracle Certified Professional (OCP) – Oracle 11g, 10g, 9i and 8iSUN Certified – Solaris System Administrator in SUN Solaris 9

Page 3: Aioug ha day oct2015 goldengate- High Availability Day 2015

3Patterns

ORACLE GOLDENGATE 12c

Introduction

Page 4: Aioug ha day oct2015 goldengate- High Availability Day 2015

4Patterns

Database Replication Options

Data Guard

Active Data Guard

InfoSphere Change

Data Capture for

Oracle Replication

Page 5: Aioug ha day oct2015 goldengate- High Availability Day 2015

5Patterns

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 provides low-impact capture, routing, transformation, and delivery of database transactions across heterogeneous environments in near-real time.

Oracle Golden Gate moves committed transactions from redo logs and maintainstransaction integrity with sub-second latency

Page 6: Aioug ha day oct2015 goldengate- High Availability Day 2015

6Patterns

Oracle GoldenGate – Supported Platforms

Choice can be made from 2 types of Oracle GoldenGate (OGG):

Supported Databases Supported Operating Systems

z/OS, iSeries, z/LinuxAlways check the latest Certification Matrix

Page 7: Aioug ha day oct2015 goldengate- High Availability Day 2015

7Patterns

ORACLE GOLDENGATE

Topologies

Page 8: Aioug ha day oct2015 goldengate- High Availability Day 2015

8Patterns

Oracle GoldenGate Topologies

UNIDIRECTIONAL QUERY OFFLOADING

BIDIRECTIONAL STANDBY DB OR ACTIVE-ACTIVE FOR

HIGH-AVAILABILITY

PEER-TO-PEER LOAD BALANCING,

MULTIMASTER

BROADCAST DATA DISTRIBUTION

INTEGRATION / CONSOLIDATION DATA WAREHOUSE CASCADING MARTS

Page 9: Aioug ha day oct2015 goldengate- High Availability Day 2015

9Patterns

TRANSACTIONALDATA INTEGRATION

OPERATIONALBUSINESS

INTELLIGENCE

HIGH AVAILABILITYSTANDBY(OPEN & ACTIVE)

Oracle GoldenGate 12c

OLTP SYSTEMS

ORACLEGOLDEN

GATE

ZERO DOWN-TIME UPGRADES & MIGRATIONS

NEW DB / OS /HW

LIVE REPORTINGREPORTINGDATABASE

ODS . EDW .

EDW .

ETL

ETL

ETL

ETL

ETLMESSAGE BUS

Page 10: Aioug ha day oct2015 goldengate- High Availability Day 2015

10Patterns

Benefits Of Oracle GoldenGate

High Availability (Standby Database)

Zero Down-Time Upgrades and Migrations

Live Reporting (Reporting Database)

Operational Business Intelligence

Transactional Data Integration

Page 11: Aioug ha day oct2015 goldengate- High Availability Day 2015

11Patterns

Oracle Golden Gate Solutions for Oracle Database

Upgrade Oracle Database versions 8i, 9i, 10g or 11g to 12c

Migrate from non-Oracle databases to Oracle 12c

Upgrade or migrate the database server or operating system

Perform database maintenance

Page 12: Aioug ha day oct2015 goldengate- High Availability Day 2015

12Patterns

SERVER: Golden Gate 1 (Source)

Oracle GoldenGate 12c – Source and Target SC

HEM

AS

AP

AR

SYS

HR

WHLGWR

Process

DATABASE: ORACLE

Writes database

Changes to redo log

files

Online Redo

Log Files

GoldenGateextract process

(HREXT)- - -

only reads redo for HR schema

Reads

redologfiles

GoldenGatedata pump

process

GoldenGateTrail Files

File grows until records are processed

Rea

ds

Trai

l Fi

les

Extract

WritesHR schema

changes to

SERVER: Golden Gate 2 (Target)

SCH

EMA

S SYS

HR

DATABASE: ORACLE

GoldenGateReplicat (RPHR01)

process

Changes written to

HR Schema

GoldenGateCollectorprocess

Trail files grow until

data processed

Reads Trail Files

Writes toTrail Files

GoldenGateData Pump

writes

Writes to collectors

Page 13: Aioug ha day oct2015 goldengate- High Availability Day 2015

13Patterns

Oracle GoldenGate Solutions for Oracle Database

Eliminate Down-Time During Oracle Database Upgrades

Eliminate Unplanned Down-Time With Active Data Guard

Improve Production System Performance

Real-Time Reporting from a Lower-Cost System

Increase ROI On Existing Servers and Synchronize Global Data

Page 14: Aioug ha day oct2015 goldengate- High Availability Day 2015

14Patterns

ELIMINATE DOWN-TIME DURING ORACLE DATABASE UPGRADES

ZERO DOWN-TIME DATABASE UPGRADES

CAPTURE

DELIVERYCAPTURE

DELIVERY

REAL-TIME UPDATES

POST-SWITCHOVER DATA FLOW

Route (LAN/WAN/Web/IP)

ORACLE

8i / 9i / 10g

ORACLE

11g

APPLICATION

SWITCH OVER

COMPARE & VERIFY

Page 15: Aioug ha day oct2015 goldengate- High Availability Day 2015

15Patterns

ELIMINATE UNPLANNED DOWN-TIME WITH ACTIVE DATA GUARD

CAPTURE

DELIVERYCAPTURE

DELIVERY

REAL-TIME UPDATES

POST-SWITCHOVER DATA FLOW

Route (LAN/WAN/Web/IP)

APPLICATION

SWITCH OVER

SOURCE

STANDBY SERVER COULD BE USED FOR

REPORTING, QUERING, TESTING….

DISASTER RECOVERY & DATA PROTECTION

STANDBY

Page 16: Aioug ha day oct2015 goldengate- High Availability Day 2015

16Patterns

IMPROVE PRODUCTION SYSTEM PERFORMANCE & LOWER COSTS

QUERY OFFLOADING

CAPTURE DELIVERY

REAL-TIME UPDATES

Route (LAN/WAN/Web/IP)

APPLICATION

TRANSACTION PROCESSING

ACTIVITY

LEGACY PRODUCTIONOLTP

ORACLE REPLICA

READ-ONLYACTIVITY

Page 17: Aioug ha day oct2015 goldengate- High Availability Day 2015

17Patterns

ORACLE GOLDENGATE FOR OPERATIONAL REPORTING

OPERATIONAL REPORTING

PRODUCTIONDATABASE

REPORTINGINSTANCE

CAPTURE DELIVERY

REAL-TIME UPDATES

Route (LAN/WAN/Web/IP)

OLTPAPPLICATION

REPORTINGAPPLICATION

CAPTURE DELIVERY

Route (LAN/WAN/Web/IP)

Sddsgsdggdsgfsfsfddsjgdggdgjkddgdkjdddn dnjnd dsgnjnsdgnjngjngjndjdnsgjdjnjdsg njn dnjdjgn jnjgnjdg dDgjdjgjk d jsdgbjjsdj jbdsg jbsdgjbdsg sbdgbsdjbbsdg jsdbgsdgbbkbgdgkjbdgjkbgsjkdbgjbg jksg jbjdjdj

TRAIL FILE

Sddsgsdggdsgfsfsfddsjgdggdgjkddgdkjdddn dnjnd dsgnjnsdgnjngjngjndjdnsgjdjnjdsg njn dnjdjgn jnjgnjdg dDgjdjgjk d jsdgbjjsdj jbdsg jbsdgjbdsg sbdgbsdjbbsdg jsdbgsdgbbkbgdgkjbdgjkbgsjkdbgjbg jksg jbjdjdj

TRAIL FILE

Page 18: Aioug ha day oct2015 goldengate- High Availability Day 2015

18Patterns

INCREASE ROI ON EXISTING SERVERS & SYNCHRONIZE GLOBAL DATA

ACTIVE - ACTIVE

SOURCE & TARGET DB SOURCE & TARGET DB

CAPTUREDELIVERY

REAL-TIME UPDATES

Route (LAN/WAN/Web/IP)

APPLICATION APPLICATION

DELIVERY CAPTURE

Page 19: Aioug ha day oct2015 goldengate- High Availability Day 2015

19Patterns

Replicat applies data with transaction integrity

ORACLE GOLDENGATE – THE WAY IT WORKS

EXTRACT

REPLICATTRAIL FILES

PUMP

• LAN• WAN • INTERNET• OVER TCP / IP

SOURCE ORACLE &NON-ORACLEDATABASE

CAPTURE

DELIVERYTRAIL FILES

PUMP TARGETORACLE &

NON-ORACLEDATABASE

REPLICAT

EXTRACT

ExtractCommitted transactions are captured (and can be filtered) as they occur by reading the transaction logs.

Trail Stages and Queues Data for Routing

Pump Distributes Data for Routing to Target(s)

Route Data is Compressed, Encrypted for Routing to Target(s)

← B I - D I R E C T I O N A L →

Page 20: Aioug ha day oct2015 goldengate- High Availability Day 2015

20Patterns

ORACLE GOLDENGATE

Components

Page 21: Aioug ha day oct2015 goldengate- High Availability Day 2015

21Patterns

ORACLE GOLDEN GATE LOGICAL ARCHITECTURE

EXTRACT

EXTRACT

REPLICAT

REPLICATCOLLECTOR

DATA PUMP

MANAGERMANAGER

NET

WO

RK

DATA SOURCE FOR INITIAL LOAD: SOURCE TABLES

INITIAL LOAD

TRAIL OR FILE

CHANGE SYNCHRONIZATION

DATA SOURCECHANGESYNCHRONIZA-TION:TRANSACTIONLOG

(OPTIONAL)

Page 22: Aioug ha day oct2015 goldengate- High Availability Day 2015

22Patterns

Oracle GoldenGate Components

Source Database

Target Database

Server Collector: Reassembles and writes data to an OGG trail files.

Replicat: Queued transactions that are stored in the trail files, reads the trail file and applies to the target database by using native SQL calls.

Extract: Captures transactional changes from transaction logs (Change Data Capture).

Trail: After the capture process, OGG converts the committed transactions into canonical data format in “trail” files.

Pump: One more capture component can be used to pump the data to multiple targets and is used for better recoverability.

Manager: Required to start and stop processes & responsible for monitoring, restarting processes, allocating data storage, reporting errors and events

Page 23: Aioug ha day oct2015 goldengate- High Availability Day 2015

23Patterns

Source Database – Configuration Files

GGSCI (ogg-wokshop) 27> view param mgrPORT 15500DYNAMICPORTLIST 15510-15520PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS

GGSCI (ogg-wokshop) 28> view param extprmEXTRACT extprmTRANLOGOPTIONS DBLOGREADEREXTTRAIL ./dirdat/eaUSERID ogguser, PASSWORD oracleSTATOPTIONS RESETREPORTSTATSREPORT AT 12:00REPORTROLLOVER AT 12:00REPORTCOUNT EVERY 60 SECONDS, RATETABLE scott.*;

GGSCI (ogg-wokshop) 29> view param pmpprmEXTRACT pmpprmRMTHOST ogg-wokshop, MGRPORT 15000, COMPRESSRMTTRAIL ./dirdat/paPASSTHRUTABLE scott.*;

GGSCI (ogg-wokshop) 30> info allProgram Status Group Lag at Chkpt Time Since ChkptMANAGER RUNNINGEXTRACT RUNNING EXTPRM 00:00:00 00:00:10EXTRACT RUNNING PMPPRM 00:00:00 00:00:09

Page 24: Aioug ha day oct2015 goldengate- High Availability Day 2015

24Patterns

Target Database – Configuration Files

GGSCI (ogg-wokshop) 35> view param mgrPORT 15000DYNAMICPORTLIST 15010-15020PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS

GGSCI (ogg-wokshop) 36> view param repdbREPLICAT REPDBASSUMETARGETDEFSDISCARDFILE ./dirout/REPDB.DSC, PURGEUSERID ogguser, PASSWORD oracleMAP scott.*, TARGET scott.*;

GGSCI (ogg-wokshop) 37> info allProgram Status Group Lag at Chkpt Time Since ChkptMANAGER RUNNINGREPDB RUNNING REPDB 00:00:00 00:00:09

Page 25: Aioug ha day oct2015 goldengate- High Availability Day 2015

Checkpoints

Page 26: Aioug ha day oct2015 goldengate- High Availability Day 2015

26Patterns

CHECKPOINTS - CAPTURE

SOURCE DATABASE CAPTURE COMMIT ORDERED SOURCE TRAIL

CAPTURE CHECKPOINT

BEGIN : TX1

INSERT : TX1

BEGIN : TX2

UPDATE : TX1

INSERT : TX2

COMMIT : TX2

BEGIN : TX3

INSERT : TX3

BEGIN : TX4

COMMIT : TX3

DELETE : TX4

Start of Oldest Open (Uncommited)

Transaction_____________________________________________

______

CU

RR

ENT

REA

D P

OSI

TIO

N

CU

RR

ENT W

RITE P

OSITIO

N

BEGIN : TX2

INSERT : TX2

COMMIT : TX2

BEGIN : TX3

INSERT : TX3

COMMIT : TX3

CAPTURECHECK POINT

Page 27: Aioug ha day oct2015 goldengate- High Availability Day 2015

27Patterns

PUMP COMMIT ORDERED TARGET TRAIL

_____________________________________________

______

CU

RR

ENT

REA

D P

OSI

TIO

N

CU

RR

ENT W

RITE P

OSITIO

N

CHECKPOINTS - CAPTURE

PUMPCHECK POINT

PUMP CHECKPOINT

CHECKPOINTS - CAPTURE - PUMP

BEGIN : TX2

INSERT : TX2

COMMIT : TX2

Page 28: Aioug ha day oct2015 goldengate- High Availability Day 2015

28Patterns

DELIVERY

_____________________________________________

______

CU

RR

ENT

REA

D P

OSI

TIO

N

CHECKPOINTS - CAPTURE - PUMP

PUMPCHECK POINT

DELIVERY CHECKPOINT

CHECKPOINTS - CAPTURE - PUMP - DELIVERY

TARGET DATABASE

Page 29: Aioug ha day oct2015 goldengate- High Availability Day 2015

29Patterns

CHECKPOINTS - CAPTURE - PUMP - DELIVERY

Page 30: Aioug ha day oct2015 goldengate- High Availability Day 2015

30Patterns

ORACLE GOLDENGATE

Performance Tuning

Page 31: Aioug ha day oct2015 goldengate- High Availability Day 2015

31Patterns

Tune TCPBUFSIZE and TCPFLUSHBYTES

Calculate the bandwidth-delay product (BDP).Example: if the network between the source and target databases is 155 megabits per second (Mbits) and the latency is 39ms, the calculation would be as follows:BDP = (155,000,000 / 8) * 0.039 = 755,625bytes

Multiply the result by 3 to determine 3xBDP.

Example: 3xBDP = 755,625 x 3 = 2,266,875In this example, because the result is more than 1MB, set the TCPBUFSIZE and TCPFLUSHBYTES parameters to 2,266,875.

The parameters are set in the Data Pump parameter file.RMTHOST target, MGRPORT 7809, TCPBUFSIZE 2266875, TCPFLUSHBYTES 2266875

The two RMTHOST parameters, TCPBUFSIZE and TCPFLUSHBYTES, are very useful for increasing the buffer sizes and network packets sent by Data Pump over the network from the source to the target system.

This is especially beneficial for high latency networks.

These parameters should be set to a value of 1MB (1,048,576 bytes) or the calculated value, whichever is larger.To determine suitable values for these parameters, execute the following steps:

Use the ping command to obtain the average round trip time (RTT).Output from PING command: Minimum = 31ms, Maximum = 61ms, Average = 39ms

Page 32: Aioug ha day oct2015 goldengate- High Availability Day 2015

32Patterns

Startup Speed - DynamicResolution

EXAMPLE

EXTRACT EORA01

USERID ggadmin, PASSWORD ggadmin

EXTTRAIL ./dirdat/lt

DYNAMICRESOLUTION

TABLE SOURCE.TCUSTMER;

TABLE SOURCE.TCUSTORD;

STARTUP SPEED

When a process starts, it queries the database system tables to retrieve table metadata and builds a structure in

memory. Analyzing many tables takes time

Solution

DynamicResolution parameter adds table’s attributes to the object record the first time its object ID enters the

transaction log. This parameter builds out the columns only when a table is used.

Page 33: Aioug ha day oct2015 goldengate- High Availability Day 2015

33Patterns

Monitoring : What is Lag?

GOLDEN GATE GOLDEN GATE

EXTRACT SOURCE TRAIL PUMP

TCP

TARGET TRAIL REPLICAT

Sou

rce

Co

mm

itTi

mes

tam

p

Syst

em T

ime

Wri

te t

o T

rail

Syst

em T

ime

Wri

te t

o T

rail

Targ

et C

om

mit

Tim

esta

mp

REPLICATE LAG“End-to-End” LATENCY

● ● ● ● ● ● ● ● ● ● ●

EXTRACT LAG

PUMP LAG

Page 34: Aioug ha day oct2015 goldengate- High Availability Day 2015

34Patterns

● ● ● ● ●

If the lag in EXTRACT, Start

Here!

● ● ● ● ●

If the lag in PUMP, check for

Lag in EXTRACT

● ● ● ● ●

If the lag in REPLICAT, check for Lag in PUMP

Identifying the Bottlenecks

EXTRACT REPLICAT

SOURCE TRAIL PUMP

LAN / WAN

INTERNET

TARGET TRAIL REPLICATSOURCE DATABASE

TARGET DATABASE

MANAGER MANAGER

← Monitoring Lag – Working from the Target back to the Source

If the (latency) in

REPLICAT is acceptable

then All is Well

Throughput Statistics are also useful in identifying potential bottlenecks

Page 35: Aioug ha day oct2015 goldengate- High Availability Day 2015

35Patterns

Finding Oracle GoldenGate Latency/Lag

For integrated Extract:SQL> SELECT capture_name, 86400 *(available_message_create_time -capture_message_create_time) latency_in_secondsFROM GV$GOLDENGATE_CAPTURE;

For integrated Replicat:SQL> SELECT r.apply_name, 86400 *(r.dequeue_time - c.lwm_message_create_time)latency_in_secondsFROM GV$GG_APPLY_READER r, GV$GG_APPLY_COORDINATOR c WHERE r.apply# = c.apply# and r.apply_name = c.apply_name;

Latency or lag is the period of time that has passed between when a change (DML or DDL) occurred in

the source database and the current point in time.

Example: Extract latency is the time that has elapsed since the change occurred to the source table and

the time it was extracted and written to the trail file. Conversely, Replicat latency is the time that has

elapsed from the source table change to the time it was applied to the target database.

When using integrated Extract or integrated Replicat, the latency can be determined from the database using the following queries:

Page 36: Aioug ha day oct2015 goldengate- High Availability Day 2015

36Patterns

Monitoring - Lag

TO VIEW LAG, USE THE SEND OR LAG COMMANDS GGSCI> send {Extract | Replicat} , GetLag (OR) GGSCI> lag {Extract | Replicat | ER}

YOU CAN USE INFOR, DETAIL COMMAND TO VIEW LAG GGSCI> Info {Extract | Replicat | ER}, detail

CHECKING VOLUME STATISTICS

Using Report (OR) ReportCount parameters Using the Stats command

GGSCI> send {Extract | Replicat} <group>, report

GGSCI> view report <group>

GGSCI> view report <filename>

GGSCI> send {Extract | Replicat} <group>, report

GGSCI> stats {Extract | Replicat | ER} {<group/wildcard>} [Table <name/wildcard>]

Regularly monitor lag and processing volume of extraction and replication

Continuous excess lag usually indicates a bottleneck in one or both processes

Compare Extract’s processing volume with Replicat’s volume

Extract usually faster. Replicat must construct and apply SQL statements

Page 37: Aioug ha day oct2015 goldengate- High Availability Day 2015

37Patterns

Monitoring – Determining Lag using Checkpoints

To view the Extract checkpoint in the trail, use the following commands:GGSCI> Info Extract <group>, ShowCh

GGSCI> Info Extract <group>, Detail

GGSCI> Info Replicat <group>, Detail

Page 38: Aioug ha day oct2015 goldengate- High Availability Day 2015

38Patterns

Install the UTL_SPADV Package (Integrated Extract and Integrated Replicat)

To install SPADV, execute the following steps:

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.

c. Run the utlspadv.sql script. For example:SQL> @$ORACLE_HOME/rdbms/admin/utlspadv.sql

The UTL_SPADV PL/SQL package provides subprograms to collect and analyze statistics for the LogMiner serverprocesses. The statistics help identify any current areas of contention such as CPU or I/O.

The Oracle Streams Performance Advisor (SPADV) enables monitoring of the integrated GoldenGate serverprocesses which are used by integrated Extract and integrated Replicat, and provides information about how theseprocesses 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.

Page 39: Aioug ha day oct2015 goldengate- High Availability Day 2015

39Patterns

Gather Statistics using the UTL_SPADV Package

To gather statistics every 15 seconds, run the following SQL*Plus command as the Oracle GoldenGateadministrator:SQL> exec UTL_SPADV.START_MONITORING(interval=>15);

To stop statistics gathering, run the following command:SQL> exec UTL_SPADV.STOP_MONITORING;

Run the following commands to determine if the monitoring job is currently running:

SET SERVEROUTPUT ONDECLAREis_mon BOOLEAN;BEGINis_mon := UTL_SPADV.IS_MONITORING(job_name => 'STREAMS$_MONITORING_JOB',client_name => NULL);IF is_mon=TRUE THENDBMS_OUTPUT.PUT_LINE('The monitoring job is running.');ELSEDBMS_OUTPUT.PUT_LINE('No monitoring job was found.');END IF;END;/

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.

Page 40: Aioug ha day oct2015 goldengate- High Availability Day 2015

40Patterns

Generating Report - UTL_SPADV Package

spool /tmp/spadv.txt

beginutl_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 followingcommand:

SQL> exec UTL_SPADV.STOP_MONITORING(PURGE=>TRUE);

It is also possible to create a static report of SPADV statistics after monitoring for a period of time. The report can begenerated 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:

Page 41: Aioug ha day oct2015 goldengate- High Availability Day 2015

41Patterns

Tune the Manager Process

Manager can be tuned to restart processes that terminate abnormally:

Use the AutoRestart Manager parameter

(If the database goes down, autorestarting ensures that GoldenGate processes start again after recovery)

Use the AutoStart Manager parameter

(Starts processes when Manager starts)

Use the BootDelayMinutes parameter

(When database services must be started before starting Oracle GoldenGate processes)

Page 42: Aioug ha day oct2015 goldengate- High Availability Day 2015

42Patterns

Tune the Extract Process

DATA FILTERING & DATA CONVERSION

Data filtering and Data conversion can cause performance degradation because we have to do extra work. Instead

of using Extract process, use Replicat or data pump to perform filtering and conversion.

We can use parallel pumps or Replicats

To remove the overhead from the source system, you can use data pumps on an intermediate system or the

target system.

This may not be the best option when the data pump is performing filtering

DATABASE FETCHING

Identify tables that generates fetches, generate long transactions, and use SQL procedures that fetch data

Separate into one or more separate extract groups

Keep tables with relational constraints to each other in the same group

Large tables with heavy LOB volume may require multiple extract groups for each

Use the @RANGE function to divide the load in a safe, scalable manner

Using multiple Extract requires multiple trails. You need a data pump and Replicat for each one

Page 43: Aioug ha day oct2015 goldengate- High Availability Day 2015

43Patterns

Tune the Replicat Process

DIVIDE THE LOAD

Replication is a single threaded process that applies operation one at a time by using regular SQL. It is a bottleneck!

Divide the load into multiple Replicat groups that work in parallel

Try splitting the load by schema

You can try using a different group for each table

Keep those tables with relational constraints in the same group

@RANGE function: you can split a table among multiple groups so that row operations can be performed in

parallel

The @RANGE function is an easy, safe and scalable way to divide the rows among different processing groups.

It preserves data integrity by guaranteeing that the same row is always processed by the same group.

Note 1: The number of groups support depends on the memory resources available on the system. EachExtract and Replicat process needs approximately 25 MB to 55 MB of memory.

Note 2: If you split one table among multiple replicats, you cannot do DDL replicationon that table, only DML.

Page 44: Aioug ha day oct2015 goldengate- High Availability Day 2015

44Patterns

Tune the Replicat Process

Example Of DIVIDE THE LOAD

If there are a small number of tables that contain a large percentage of DML which, after dividing into theirown Replicat processes, are still not applying the data fast enough, these tables can be further distributedamong Replicat processes using the @RANGE function.

For example, distributing a table between two Replicat processes would use the following MAP parameters:

Replicat #1:

MAP SOESMALL.ORDER_ITEMS , TARGET soesmall.ORDER_ITEMSFILTER (@RANGE (1, 2, ORDER_ID));

Replicat #2:

MAP SOESMALL.ORDER_ITEMS , TARGET soesmall.ORDER_ITEMSFILTER (@RANGE (2, 2, ORDER_ID));

The preceding example shows that the table SOESMALL.ORDER_ITEMS is partitioned using the primary key column ORDER_ID between two Replicat processes.

Page 45: Aioug ha day oct2015 goldengate- High Availability Day 2015

Patterns Software Design Institute Pvt. Ltd.www.patterns-sdi.com

ORACLE GOLDENGATE

Introduction