You are on page 1of 40

High Availability Best

Practices with Oracle


GoldenGate, DataGuard
and XAG
Enterprise Replication Server Technologies

Oracle Corporation

Copyright 2015, Oracle and/or its affiliates. All rights reserved. |


Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied upon
in making purchasing decisions. The development, release, and timing of any features or
functionality described for Oracles products remains at the sole discretion of Oracle.

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 3


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 4


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 5


How Oracle GoldenGate Works
Capture: committed transactions are captured (and can be filtered) 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).


Delivery: applies data with transaction integrity,
transforming the data as required.

Capture Trail Pump Trail Delivery


Files Files

Trail LAN / WAN / Internet Trail


Delivery Over TCP/IP Pump Capture
Source Files Files Target
Oracle & Non-Oracle Oracle & Non-Oracle
Database(s) Bi-directional Database(s)

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 6


Integrated Extract and Integrated Replicat: Overview
Oracle only
Integrated Extract introduced in GoldenGate 11.2.1
requires 11.2.0.3 RDBMS
Integrated Dictionary Support available with 12.1.2.0.0 (requires 11.2.0.4 RDBMS)
Integrated Replicat introduced in 12.1.2.0.0 (requires 11.2.0.4 RDBMS or above)

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 7


Integrated Extract
Key Features
Flexible Deployment Options
Upstream/downstream
Supports Multitenant Environments
Extract can be configured to capture data from any or all PDBs in a multitenant database
Full Integration with the Database
Transparent support for thread events and asymmetric configurations
Transparent support for RAC-One
Transparent support for resetlog events
Transparent handling of redo fuzziness around failover
Supports both SYNC and ASYNC role transitions

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 8


Integrated Replicat
Key Features
Improved usability and performance
Applies source transactions in parallel based on dependencies between transactions
Automatic tuning of parallelism based on workload
Conflict detection and resolution
GoldenGate CDR, REPERROR, and HANDLECOLLISIONS
DML, DDL and error handlers
Unhandled errors redirected to Replicat for retry and failure processing
Session redo tags provide fine-grained filtering, such as cycle prevention in
bidirectional replication

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 9


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 10


Oracle Active Data Guard
Disaster Recovery and Read-Only Offload to an Active Standby
Fast
Incremental
Read-write Real-time Reporting
Observer Backups
Workload

Data Guard

SYNC / ASYNC

Active
Primary Standby
Database Database

Primary Site Standby Site

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 11


Oracle Data Guard Concepts
Switchover: Planned role transition from a primary database to one of its
standby database.
DGMGRL > SWITCHOVER TO CHICAGO
Requires connectivity to both primary and standby database
Ensures all redo has shipped
Orderly transition (both databases agree on every thing)

Failover:
DGMGRL > FAILOVER TO CHICAGO
No connectivity with primary
New primary becomes the source of truth

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 12


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 13


Oracle Grid Infrastructure Bundled Agent (XAG)

Clusterware specific to managing GoldenGate resources


XAG allows you to register a GoldenGate instance with CRS to provide HA
It solves the key process related issue of ensuring availability of the
GoldenGate instance in the face of failures.
Loss of instance (RAC node failover)
Loss of primary database (Data Guard Failover integration)

Use AGCTL for registering/starting and stopping resources

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 14


Oracle Grid Infrastructure Bundled Agent (XAG)
Download the latest version (v7.1) available from:
http://www.oracle.com/technetwork/database/database-
technologies/clusterware/downloads/index.html
Install outside of Grid Infrastructure ORACLE_HOME and make sure OS
user PATH finds this XAG before the GI installed version

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 15


Whats new for GoldenGate 12.2
Support for fetch from ADG
Enable with FETCHUSERID ggadmin@adg_inst password pwd or FETCHUSERIDALIAS
ggadmin_adginst
GoldenGate maintains consistency of data fetched from the standby database

Sourceless Downstream Integrated Extract


Improve HA by eliminating back channel to source database (NOUSERID)
Requires 12.1.0.2 RDBMS or 11.2.0.4 with GG patch

Tighter Integration with XAG


Specify enable_xag in globals file
Start and stop mgr, extract, pump or replicat from GGSCI not AGCTL
View XAG instance info with info all and info goldengate [instance_name] commands

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 16


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 17


Sample Deployment
Observer

Primary Database Standby Database

Integrated
Extract LogMining
Server
Redo Transport
(SYNC or ASYNC)

Trail and other OGG Files Bidirectional


In DBFS GoldenGate Replication

Redo Transport

OCI Connection
Warehouse
File I/O

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 18


Sample Deployment Post Role Transition
Observer

(OLD) Primary Database (NEW) Primary Database

Integrated
LogMining LogMining Extract
Server Server

Trail/Checkpoint/BR Files Bidirectional


In DBFS GoldenGate Replication
Redo Transport

OCI Connection

File I/O
Warehouse

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 19


Downstream Sample Deployment for Data Guard
Observer
Primary Database Standby Database

Redo Transport
(SYNC or ASYNC)

(ASYNC)

Redo Transport
LogMining
Server Redo Transport
(SYNC or ASYNC)
OCI Connection

Trail and other OGG Downstream


File I/O Files In DBFS Integrated Standby Database
Extract

Downstream
Primary Database
Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 20
Downstream Sample Deployment for Data Guard
Observer
Primary Database Standby Database

Redo Transport
(SYNC or ASYNC)

(ASYNC)

Redo Transport
LogMining
Server Redo Transport
(SYNC or ASYNC)
OCI Connection

Trail and other OGG Downstream


File I/O Files In DBFS Integrated
Extract
Standby Database

Downstream
Primary Database
Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 21
Downstream Sample Deployment Post Failover
Observer
(OLD) Primary Database (NEW) Primary Database

(ASYNC)

Redo Transport
LogMining
Server Redo Transport
OCI Connection (SYNC or ASYNC)

Trail and other OGG Downstream


File I/O Files In DBFS Integrated
Extract
Standby Database

Downstream
Primary Database
Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 22
Downstream Sample Deployment Post Failover #2
Observer
(OLD) Primary Database (NEW) Primary Database

(ASYNC)

Redo Transport LogMining


Server

OCI Connection

Integrated Trail and other OGG


File I/O Downstream Extract Files In DBFS
(OLD) Primary Database
Downstream
(NEW) Primary Database

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 23


Database Connectivity
Make all OGG components connect to database using Role-Based Services
Declarative way to specify a service should be published only when the database
has a specific role
Publish a service only when database has the PRIMARY role
Create role-based service (12c syntax):
srvctl add service -db GGS2PRMY -service oggserv -role PRIMARY
-preferred GGS21 -available GGS22
srvctl add service -db GGS2STBY -service oggserv -role PRIMARY
-available GGS21

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 24


GoldenGate Configuration
XAG seamlessly relocates GoldenGate on instance or primary failure
Consistency of GoldenGate data and metadata ensured with DBFS
Store trail and checkpoint data on DBFS to guarantee consistency on role transitions
Provides flexible routing of trail data post role transition
Use a Virtual IP to identify the TARGET host machine
Transferred between primary and standby on role transition
See MOS note 1950121.1 for automatically redirecting Data Pump after TARGET database role
transition if VIP not available
Enable AUTOSTART of the Data Pump process on the SOURCE
After a role transition completes Data Pump will restart sending trails to new primary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 25


Create DBFS CRS Resource
DBFS is mounted on RAC node that will run GoldenGate
Create CRS action script (MOS note 1054431.1)
Must contain START, STOP, CHECK functions
Create CRS resource:
crsctl add resource dbfs_mount -type cluster_resource \
-attr "ACTION_SCRIPT=$ACTION_SCRIPT, CHECK_INTERVAL=30,RESTART_ATTEMPTS=10, \
START_DEPENDENCIES='hard(ora.$DBNAME.db)pullup(ora.$DBNAME.db)',\
STOP_DEPENDENCIES='hard(ora.$DBNAME.db), SCRIPT_TIMEOUT=300"

DBFS service will be managed from Bundled Agent

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 26


Register GoldenGate with Bundled Agent (XAG)
Register with XAG at the primary creating the VIP (as root)
agctl add goldengate ggprmy --gghome /u01/oracle/goldengate --oracle_home $ORACLE_HOME
--db_services ora.oggserv.svc--filesystems dbfs_mount --monitor_extracts ext1,dpump1
--monitor_replicats rep1--environment_vars TNS_ADMIN= --dataguard_autostart yes
--nodes prmy1A,prmy1B --user oracle --group oinstall --network 1 --ip 192.168.0.54

Register with XAG at the standby (as oracle, without creating a VIP)
agctl add goldengate ggstby --gghome /u01/oracle/goldengate --oracle_home $ORACLE_HOME
--db_services ora.oggserv.svc --filesystems dbfs_mount --monitor_extracts ext1,dpump1
--monitor_replicats rep1 --environment_vars TNS_ADMIN= --dataguard_autostart yes
--nodes stdby1
Start Extract using Agent Control
agctl start goldengate ggprmy

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 27


Data Guard Bounded Data Loss (ASYNC)
Data Guard in MaxPerformance(ASYNC) mode permits data loss on the
standby
Amount of data loss with FSFO controlled by FastStartFailoverLagLimit
(default is 30seconds)
Extract must only mine from redo already applied to Standby
Prevents data being replicated to a target database and then missing from the
source after a failover
Add Integrated Extract parameter TRANLOGOPTIONS HANDLEDLFAILOVER

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 28


Configuration Recommendation Summary
Bundled Agent version 7.1 and above
GoldenGate 12.1 and above
GoldenGate Integrated Extract and Integrated Replicat
Role-based services for GoldenGate database connectivity
DBFS for GoldenGate shared file system
Integrated Extract parameter TRANLOGOPTIONS HANDLEDLFAILOVER for
ASYNC Data Guard

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 29


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 30


Copyright 2015, Oracle and/or its affiliates. All rights reserved. |
Copyright 2015, Oracle and/or its affiliates. All rights reserved. |
High Level Architecture
GoldenGate Source GoldenGate Source
Primary Database (UK) Standby Database (Amsterdam)
Exadata X3-8 Exadata X3-8
2 Node RAC Redo Transport 2 Node RAC
With XAG (ASYNC MaxPerformance) With XAG

Integrated
Integrated LogMining LogMining
Extract
Extract Server Server

Trail and other OGG Files


Trail and other OGG Files
In DBFS
In DBFS
GoldenGate
Data Pump

Redo Transport
Exadata X3-8 (ASYNC MaxPerformance)
Exadata X3-8
2 Node RAC 2 Node RAC
With XAG With XAG

GoldenGate Target GoldenGate Target


Primary Database (UK) Standby Database (Amsterdam)
Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 33
Environment
Four Exadata X3-8 servers
Oracle Enterprise Database 11.2.0.4.16
Oracle Grid Infrastructure 11.2.0.4.0
Oracle Grid Infrastructure Bundled Agent (XAG) 6.1
Oracle GoldenGate 12.1.2.0.0
Source database peak load redo generation of 8.1TB/hour
Replicating 7146 database tables
Trail file generation rate of 7GB/hour

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 34


GoldenGate Configuration
Integrated Extract with TRANLOGOPTIONS HANDLEDLFAILOVER
Non-integrated Replicat
DBFS configured in source and target databases storing BR, dirdat, dirtmp
and dirchk directories
GoldenGate processes registered with XAG to handle automatic failover
between RAC nodes
XAG handles Data Guard role transitions (switchover and failovers)
Heartbeat table used to monitor and alert GoldenGate lag

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 35


Failures covered by MAA configuration
XAG seamlessly relocates GoldenGate processes to any node in the cluster
XAG automatically fails over GoldenGate processes in the event of
instance failure
XAG manages GoldenGate starting on new Data Guard primary database
after role transition without user interaction
No need for database role transition triggers
RAC failures and DG role transitions all carried out inside of required
Recovery Point Objectives (RPO) and Recovery Time Objectives (RTO)
All without manual intervention

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 36


Looking to the Future
Upgrade GoldenGate to 12.1.2.1.8
Upgrade XAG to latest version (7.1)
Convert non-integrated Replicat to integrated Replicat
Take advantage of apply auto-parallelism and enhancements
Upgrade database to Database 12c next year
Implement this MAA configuration for additional clients in our Cloud
offering

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 37


Program Agenda

1 Overview of Oracle GoldenGate


2 Overview of Oracle Active Data Guard / FSFO
3 Overview of the Grid Infrastructure Bundled Agent (XAG)
4 Configuration for GoldenGate with Data Guard
5 Case Study with GoldenGate and Data Guard
6 Summary

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 38


Summary
Seamless Data Guard role transitions with GoldenGate
No manual intervention is required with FSFO and DG Broker
Configuration makes use of:
Oracle Grid Infrastructure Bundled Agent (XAG)
DBFS for shared GoldenGate files (trails and checkpoint files)
Role based services
Integrated Extract (with HANDLEDLFAILOVER option for ASYNC DG)
Integrated Replicat is recommended

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 39


Further Reading
Important MOS Notes/White Papers
Transparent Role Transitions with Oracle Data Guard and Oracle GoldenGate
http://www.oracle.com/technetwork/database/availability/ogg-adg-2422372.pdf
Client Failover Best Practices for Highly Available Oracle Databases: Oracle Database
12c
http://www.oracle.com/technetwork/database/availability/client-failover-2280805.pdf
Oracle GoldenGate with Real Application Clusters Configuration
http://www.oracle.com/technetwork/database/features/availability/maa-goldengate-rac-
2007111.pdf

Copyright 2015, Oracle and/or its affiliates. All rights reserved. | 40

You might also like