Streams 2 GG
Streams 2 GG
Streams to
GoldenGate12c
Tech15.UKOUG
Birmingham 7th of December,2015
Zbigniew Baranowski, CERN IT-DB
About Zbigniew
Developer
Responsible for
Outline
About CERN
Online
Database
Detector
controls
systems
Archiving
Replicatio
n
Offline
Databa
se
Replication
Offline
Databases
Data rates
Data flow to each remote data center [row changes]
Row changes /month
500M
400M
300M
200M
100M
Streams
GoldenGate
400GB
300GB
200GB
100GB
10
Offline
Database
Online
Database
GoldenG
ate
Golde
REDO
GoldenGate
AD
G
G
Online
Physical
Standby
UMICH
(USA)
ROM
E
(ITAL
Y)
nGate
GoldenG
ate
e
at
G
en
d
l
MUNICH
(GERMA
NY)
IN2P3
(FRANC
E)
11
Why GoldenGate?
13
GG architecture (2010)
Source
Database
Target
Database
Redo
Logs
Replicat
Extract
Trail
Files
Datapump
File stream
Trail
Files
15
Source
Database
Target
Database
Logminer
Appl
y
Buffered
Queue
Redo
Logs
Integrated
Extract
Trail
Files
Buffered
Queue
Replicat
Extract
Datapump
File stream
Integrated
Replicat
Trail
Files
16
Evaluation - performance
HIGHER BETTER
In 2011:
-> Active Data Guard
performs the best
-> Golden Gate the
worst
IMPROVEMENT
In 2013:
-> new version of
GoldenGate (12c) beats
Streams
17
Streams vs GoldenGate
(2010)
Online
Database
Remote databases
Downstream
Capture
Database
Offline
Database
STR
STREAMS
REDO
1 month of continuous
running
Test Target
Various performance tests
Caching up (extract,
replicat)
Tuning on the repetitive
workloads (flashback
Test Target2
database)
Streams2GG Migration
Production
M
EA
R
ST
MS
EA
Testing
Test Source
GoldenGate
GSo
Tld
ReEn
AG
MaSte
20
Performance measured
Workload description:
5 days of ATLAS conditions
data
675GB of redo volume
260k of transaction
18.9 M of row changes 21
(LCRs)
CRS
RDBMS
GoldenGate
12.1.2.1.0
Extract and Replicat in integrated mode
Platform
RHEL6
23
Steps
1. Preliminary steps
Configure databases
Install GG
Set up GG process
2. Online switch between Streams and GoldenGate
stop streams
start GG
3. Validate that GG process are up and replicating
4. (Later) Drop Streams components
Capture, Propagation, Apply and AQ queues
Preparation
Preliminary steps
Database preparation
Install Golden Gate
set ENABLE_GOLDENGATE_REPLICATION=TRUE
creation of GG administrator schema
Replica
databases
GG processes
monitoring
agents
Central
GG
servers
B
C
WAN
B
NAS storage:
- GG homes
- Parameter files
- Trail files
28
29
Central GoldenGate
advantages
Improved security
Credential store
SQLPLUS> @stream2ogg.sql
gg_admin and staging directory to be specified
via CSV
file
sqlplus>
streams2ogg.customize
5)
6)
33
Recommended :
34
--GENERAL
logging data to trail files
INCLUDE ./dirprm/dbname_ggadmin.prm
USERIDALIAS ggadm@dbname
Important for UPDATE DMLs exttrail trail_path/oc
REPORTCOUNT EVERY 5 MINUTES, RATE
before and after images
WARNLONGTRANS 1H, CHECKINTERVAL 30m
stored in a single trail record
LOGALLSUPCOLS
UPDATERECORDFORMAT COMPACT
TRANLOGOPTIONS EXCLUDETAG 00
TRANLOGOPTIONS INTEGRATEDPARAMS (_CHECKPOINT_FORCE N,_CHECKPOINT_FREQUENCY 1000)
--DDL CONFIG
DDL EXCLUDE OBJNAME "*"."DBMS_TABCOMP_TEMP_CMP" EXCLUDE OBJNAME "*"."DBMS_TABCOMP_TEMP_UNCMP
INCLUDE OBJNAME SCHEMA1"."*" INCLUDE OBJNAME SCHEMA2".* --...VERY LONG
DDLOPTIONS REPORT
CONFIG
--DML
Worth
adding to manager config:
TABLEEXCLUDE "*"."DBMS_TABCOMP_TEMP_CMP" ;
TABLEEXCLUDE "*"."DBMS_TABCOMP_TEMP_UNCMP" ;
TABLE SCHEMA1"."*";
TABLE SCHEMA2"."*";
--and so on
35
#GENRAL
cascading configuration. We
GETENV (NLS_LANG)
do not tag changes applied by
INCLUDE ./dirprm/db_name_ggadmin.prm
USERIDALIAS ggadm@dbname
GG
ASSUMETARGETDEFS
discardfile ./dirrpt/CONDREP.dsc, PURGE, MEGABYTES 500
REPORTCOUNT EVERY 5 MINUTES, RATE
Taken from current Stremas
DBOPTIONS DEFERREFCONST
Apply parameters ->
DBOPTIONS SETTAG 01
customize it later
DBOPTIONS SETTAG null #DEFAULT IS 00
DBOPTIONS SUPPRESSTRIGGERS
DBOPTIONS INTEGRATEDPARAMS (COMMIT_SERIALIZATION FULL, DISABLE_ON_ERROR Y, PARALLELISM 1)
#DDL
DDLs are tagged by replicat
DDL INCLUDE OBJNAME SCHEMA1".* INCLUDE OBJNAME SCHEMA2".* --> long list
independently from DMLs
DDLOPTIONS NOTAG
#DEFAULT IS 00
DDLERROR 38307 IGNORE --ORA-38307: Object not in recycle bin
#DML
MAP SCHEMA1".* ,TARGET SCHEMA1".*,
COMPARECOLS (
ON UPDATE ALL,
ON DELETE ALL);
MAP SCHEMA2".* ,TARGET SCHEMA2".*,
COMPARECOLS (
ON UPDATE ALL,
ON DELETE ALL);
--and so on
36
Porting Streams
configuration to GG
37
Scripts generated
Simplified
content
#EXTRACT CREATION
register extract CAPTCOND database
add extract CAPTCOND, integrated tranlog, begin now, nodbcheckpoint
add exttrail trail_path/oc, extract CAPTCOND, megabytes 50
#REPLICAT CREATION
register replicat CONDREP database
add replicat CONDREP integrated, exttrail trail_path/zz, nodbcheckpoint
#DATAPUMP CREATION
add extract DPCOND, exttrailsource trail_path/oc
D
add rmttrail trail_path/zz, extract DPCOND, megabytes 500
38
Requirements
Register service
> $CRS_HOME/bin/agctl add goldengate $gg_service_name
--gg_home $gg_software_home
--oracle_home $rdbms_home
--vip_name ora.${ggmgr_host}.vip
Checking status
> agctl status goldengate my_goldengate
Goldengate instance my_goldengate' is running on serv1
>
crsstat.sh
HA Resource
----------ora.LISTENER.lsnr
ora.LISTENER_SCAN1.lsnr
ora.LISTENER_SCAN2.lsnr
ora.cvu
ora.serv1.vip
ora.serv2.vip
ora.net1.network
ora.ons
ora.scan1.vip
ora.scan2.vip
xag.my_goldengate.goldengate
Targets
----------------------------ONLINE,ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE
ONLINE,ONLINE
ONLINE,ONLINE
ONLINE
ONLINE
ONLINE
States
-----------------------------ONLINE on serv1,ONLINE on serv2
ONLINE on serv2
ONLINE on serv1
ONLINE on serv1
ONLINE on serv1
ONLINE on serv2
ONLINE on serv1,ONLINE on serv2
ONLINE on serv1,ONLINE on serv2
ONLINE on serv2
ONLINE on serv1
ONLINE on serv1
41
Sequence of actions
1) Start GG
Extract and
Datapump
2) Stop
Streams Apply
4) Start GG Replicat
Replicate after the
LastSCN
3) Check the
last
committed
SCN
by Streams
FirstSC
N
Trail files
are
produced
LastSC
N
Transactions
committed within
this period will be
ignored by replicat
Transactions
committed within
this period will be
replicated by
Timeline
@primaryD
B
43
2) Stop
Streams Apply
3) Check the
last
committed
SCN
by Streams
FirstSC
N
4) Start GG Replicat
Replicate after the
LastSCN
LastSC
N
Q: How to avoid?
A: Wait before
stopping streams
until all long
transactions are
commited and
replicated
Timeline
@primaryD
B
44
2) Stop
Streams Apply
A transaction is
heavy and slowly
being
applied@replica
If apply
will be LastSC
FirstSC
N
stopped
for N
migration this
transaction will be
lost
4) Start GG Replicat
Replicate after the
LastSCN
3) Check the
last
committed
SCN
by Streams
Q: How to avoid?
A: Do not runTimeline
Apply
@primaryD
in parallel during
B
migration
A: Set full commit
45
46
47
exec dbms_apply_adm.stop_apply(MY_APPLY);
Thats it!
48
Streams components
removal
Do not use
dbms_streams.remove_streams_configuration
dbms_capture_adm.drop_capture
dbms_apply_adm.delete_all_errors(apply_name)
dbms_apply_adm.drop_apply
dbms_propagation_adm.drop.propagation
dbms_streams.remove_queue (x2)
How do we monitor GG
53
54
Useful GG db views
Integrated Extract
Integrated Replicat
55
http
://www.oracle.com/technetwork/database/availability
/maa-gg-performance-1969630.
pdf
Future plans
Upgrade to GG 12.2.0.1
migrations, consolidations
Summary
Acknowledgments
60
Questions?
[email protected]