Ogh20180613 Rob Lasonder
Ogh20180613 Rob Lasonder
Ogh20180613 Rob Lasonder
Rob Lasonder
In dienst bij Qualogy als Exadata Specialist
Email: rob.lasonder@qualogy.com
www.rob.lasonder.org
2 1-6-2018
1
01/06/2018
Agenda
3 Agenda 1-6-2018
2
01/06/2018
5 1-6-2018
3
01/06/2018
7 1-6-2018
8 1-6-2018
4
01/06/2018
9 1-6-2018
10 1-6-2018
5
01/06/2018
11 1-6-2018
Integrated Capture (GG 11.2 NF) & Replicat (GG 12.2 NF):
Extract & Replicat processes interact with Oracle Log Mining Services
12 Agenda 1-6-2018
6
01/06/2018
13 Agenda 1-6-2018
Reference: Oracle GoldenGate Performance Tuning for Oracle Database Integration CON7773
Doc in Handout
14 1-6-2018
7
01/06/2018
Oracle by Example:
15 1-6-2018
Oracle Dataguard:
• Optimized for disaster recovery and data protection.
protection
• (physical) standby DB is a physical block-level copy of the database
• Part of Oracle Maximum Availability Architecture (MAA)
16 1-6-2018
8
01/06/2018
17 1-6-2018
18 1-6-2018
9
01/06/2018
Load &
Transform
Extract
19 1-6-2018
10
01/06/2018
IBM Power8 series (up to 8 threads per Power8 CPU) & IBM PowerVM
SGA : 38 GB
PGA : 21 GB
Avg Redo per day : 73,4 GB
Size PROD_SCHEMA : 2.111 GB
Typical characteristics:
• Maintenance silo’s: network, sysadmin, storage, DBA
• DBA has no control over (v)CPU & shared storage
• DBA lacks required privileges by default (root, and even oracle for production)
21 1-6-2018
22 1-6-2018
11
01/06/2018
23 1-6-2018
GoldenGate 12.2
• 1 technical test environment
• 1 functional test environment
• 1 production environment
24 1-6-2018
12
01/06/2018
26 1-6-2018
13
01/06/2018
27 1-6-2018
Analyse &
Architecture GG 4 Golden Gate installation & configuration
Analyse phase :
• Which data needs to be replicated (schemas, object types)
• What is the replication architecture: unilateral / bilateral, etc.
• Is any filtering / transformation required
• Type of data changes (DML only or DML and DDL)
• What is the allowed latency
• Golden Gate usage, DR & High Availability requirements
• Are any non supported mechanisms in place, like nologging
operations, transportable tablespaces (TTS), etc
28 1-6-2018
14
01/06/2018
Analyse &
Architecture GG 4 Golden Gate installation & configuration
29 1-6-2018
Analyse &
Architecture GG 4 Golden Gate installation & configuration
30 1-6-2018
15
01/06/2018
Analyse &
Architecture GG 4 Golden Gate installation & configuration
Oracle Solution for tables without PMK/UK : How to Handle Tables Without
Primary Keys or Unique Indexes With Oracle GoldenGate (Doc ID
1271578.1)
on the source database: add a column & autofill/backfill with unique value
SQL> alter table table_1 add column OGG_KEY_ID raw(16);
SQL> alter table table_1 modify OGG_KEY_ID default sys_guid();
31 1-6-2018
Analyse &
Architecture GG 4 Golden Gate installation & configuration
This error occurs when you do not specify all the columns in your coding:
Bad coding: INSERT INTO TABLE_1 VALUES ('A','B');
Good coding: INSERT INTO TABLE_1 (COL1, COL2) VALUES ('A','B');
Oracle Support did not provide a solution. An enhancement request was rejected ....
32 1-6-2018
16
01/06/2018
33 1-6-2018
• After base (12.2) install: look for latest GG patches and apply
with Opatch utililty.
34 1-6-2018
17
01/06/2018
• Report files & ggserr.log file can grow quite large and are therefore
also softlinked to shared storage (with much larger storage capacity)
35 1-6-2018
[oracle@exa01dbadm01 ~]$ gg 1
setting gg environment to
/u01/app/oracle/product/12.2/oggcore_1
36 1-6-2018
18
01/06/2018
37 Agenda 1-6-2018
Prepare the
target 4 Golden Gate installation & configuration
38 1-6-2018
19
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
39 1-6-2018
Prepare the
source 4 Golden Gate installation & configuration
40 1-6-2018
20
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
41 Aenda 1-6-2018
Prepare the
source 4 Golden Gate installation & configuration
42 Agenda 1-6-2018
21
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
43 1-6-2018
Prepare the
source 4 Golden Gate installation & configuration
-- include DDL
-- MAPPED means we only replicat DDL from the mapped objects
-- and we only want tables and indexes, no other object types
DDL &
INCLUDE MAPPED OBJTYPE TABLE &
INCLUDE MAPPED OBJTYPE INDEX
44 1-6-2018
22
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
45 1-6-2018
Prepare the
source 4 Golden Gate installation & configuration
46 1-6-2018
23
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
Some details Step 8, remote trail files after Pump is configured & started:
47 1-6-2018
Prepare the
source 4 Golden Gate installation & configuration
48 1-6-2018
24
01/06/2018
Prepare the
source 4 Golden Gate installation & configuration
49 1-6-2018
Instantiate
GG 4 Golden Gate installation & configuration
Objectives:
Objectives
• (re)instantiate the target database in maximum 8 hours.
(Source DB is 2.111 GB)
• Impact on Production should be as little as possible.
• (re)instantiation should run as an automated batch job
50 1-6-2018
25
01/06/2018
Instantiate
GG 4 Golden Gate installation & configuration
EXPDP
flashback_scn=12345678
IMPDP
51 1-6-2018
Instantiate
GG 4 Golden Gate installation & configuration
52 Agenda 1-6-2018
26
01/06/2018
Instantiate
GG 4 Golden Gate installation & configuration
53 1-6-2018
Instantiate
GG 4 Golden Gate installation & configuration
54 1-6-2018
27
01/06/2018
Instantiate
GG 4 Golden Gate installation & configuration
55 1-6-2018
Instantiate
GG 4 Golden Gate installation & configuration
Batchjobs on source
56 1-6-2018
28
01/06/2018
Instantiate
GG 4 Golden Gate installation & configuration
Batchjobs on target
57 1-6-2018
29
01/06/2018
59 1-6-2018
60 Agenda 1-6-2018
30
01/06/2018
61 1-6-2018
For now: move from SCHEMA level logging to TABLE level logging.
GGSCI> add trandata HR.table_1 (instead of add schematrandata HR)
62 1-6-2018
31
01/06/2018
63 1-6-2018
64 1-6-2018
32
01/06/2018
65 1-6-2018
33
01/06/2018
67 1-6-2018
34
01/06/2018
On the source:
GGSCI> add trandata HR.TABLE_1 COLS (A,B) NOKEY
On target:
SQL> Create unique index hr.ix_table_1 on hr.table_1 (A,B);
69 1-6-2018
• Only updates and deletes are affected negatively. Inserts are fine
• Customer has ‘snapshot’ tables which only contains inserts and
periodic deletes (overnight, cleaning up old entries)
Solution: ignore the deletes and perform them on the target outside
of the Golden Gate scope, in a nightly batch. Configure this in the
source extract parameter file:
IGNOREDELETES
TABLE HR.TABLE_2;
TABLE HR.TABLE_3;
70 1-6-2018
35
01/06/2018
71 1-6-2018
72 1-6-2018
36
01/06/2018
Changing parameters
EXTRACT
-- to minimize the latency during low volume changes
EOFDELAYCSECS 1
FLUSHCSECS 1
PUMP
-- to minimize the latency during low volume changes
EOFDELAYCSECS 1
FLUSHCSECS 1
REPLICAT
-- to minimize the latency during low volume changes
EOFDELAYCSECS 1
Reference: How can I optimize (reduce delay, lag ) throughput from NSK to a target
platform in a low volume situation. (Doc ID 1489540.1)
73 1-6-2018
74 1-6-2018
37
01/06/2018
Solution:
⇒ Temporarily exclude the table from the Replicat (tableexclude
HR.TABLE_1;) and restart the replicat.
⇒ Process all the “bad” trails with the missing column information.
⇒ Add the new column as Supplemental Logging on the source
⇒ Reinstatiate the new table, remove the tableexclude from the
Replicat and restart the Replicat
75 1-6-2018
Oracle claims in an Oracle note that you can treat DML & DDL errors with the
same error handling clause (REPERROR). I did not get it to work. In stead:
DDL Errors => DDLERROR clause
DML Errors => REPERROR clause
76 1-6-2018
38
01/06/2018
77 1-6-2018
39
01/06/2018
79 1-6-2018
40
01/06/2018
81 1-6-2018
82 1-6-2018
41
01/06/2018
Whenever you log an SR with Oracle they often ask you to run the
healthcheck script and upload the results (html file).
83 1-6-2018
database information
sys checks
configuration checks
table statistics
84 1-6-2018
42
01/06/2018
85 1-6-2018
Golden Gate has it’s own agent (JAGENT), which communicates with OEM Agent.
Every Golden Gate configuration has it’s own JAGENT installed.
Reference: https://docs.oracle.com/goldengate/em1311/gg-emplugin/EMGGP/toc.htm
86 1-6-2018
43
01/06/2018
Reference: https://docs.oracle.com/goldengate/em1311/gg-emplugin/EMGGP/toc.htm
87 1-6-2018
88 1-6-2018
44
01/06/2018
89 1-6-2018
90 1-6-2018
45
01/06/2018
91 1-6-2018
Challenge:
• Report on current Golden Gate status
• Alert if the replication lag increases or GG processes are down
• No access (as Oracle) to source database server. Only PUID access
92 1-6-2018
46
01/06/2018
93 1-6-2018
94 1-6-2018
47
01/06/2018
AIX --
/home/oracle/scripts/gg_status2.sh --
PROD
DB LINK GG_SYMP
User GGADMIN_READ with Read Acces to External Table
Advantage of this setup: we do not need access (as oracle) the source system to view the
current GG status
95 1-6-2018
96 1-6-2018
48
01/06/2018
97 1-6-2018
98 1-6-2018
49
01/06/2018
On the target:
• The INSERT_ON_TARGET Date/Time is recorded as part of the heartbeat
• This allows queries to see the Replication lag:
99 Agenda 1-6-2018
100 1-6-2018
50
01/06/2018
ON THE SOURCE
• Create Heartbeat tables on source with an automatically updated
insert_on_source date/time column
• Create some dependant objects (sequences).
• Create DBMS_SCHEDULER_JOBS to insert records every minute
ON THE TARGET
• Create a trigger to update the insert_on_target date/time column
• Enable the trigger (triggers are by default disabled by GoldenGate)
• Create some reports based on the hearbeat tables
101 1-6-2018
102 1-6-2018
51
01/06/2018
104 1-6-2018
52
01/06/2018
105 1-6-2018
106 1-6-2018
53
01/06/2018
AUTOSTART ER *
-- Starts Extract and Replicat processes when Manager starts
HA events are recorded in the ggserr.log file and manager report file:
107 1-6-2018
Application VIP
• Separate IP Address on public network (10 Gb/s)
• Added to DNS as dm1db01-appvip
108 1-6-2018
54
01/06/2018
Step 1: Make sure certain data (like parameter files, checkpoint files,
process files, etc) is on a shared location.
Step 2: Create & Start Application VIP (IP address & name must be
entered in DNS)
109 1-6-2018
110 1-6-2018
55
01/06/2018
The Golden Gate PUMP process on the source will temporarily ABEND, but will be restarted automatically by the
Manager process on the source.
111 1-6-2018
MGR and Replicat processes appear to be running on both nodes simultaneously ?????
112 1-6-2018
56
01/06/2018
The GGSCI Interface uses the shared checkpoint and process locations on the ZFS-SA to
display this information. The ACTUAL GG processes are only running on only one node
Ps –ef|grep mgr on first node
113 1-6-2018
The Golden Gate PUMP process on the source will temporarily ABEND, but will be
restarted automatically by the Manager process on the source.
114 1-6-2018
57
01/06/2018
8 Lessons Learned
116 1-6-2018
58
01/06/2018
117 1-6-2018
118 1-6-2018
59
01/06/2018
Preferably on a WIKI
119 1-6-2018
References:
Oracle GoldenGate database Schema Profile check script for Oracle DB (Doc ID 1296168.1). Script
Oracle GoldenGate database Complete Database Profile check script for Oracle DB (All Schemas)
(Doc ID 1298562.1)
GoldenGate Integrated Capture and Integrated Replicat Healthcheck Script (Doc ID 1448324.1
120 1-6-2018
60
01/06/2018
121 1-6-2018
As soon as you are outside the “Golden Gate sweetspot”, you are much
on your own, with little to no help from Oracle Support.
122 1-6-2018
61
01/06/2018
Try and supersize your Golden Gate trail file locations, both the local
trail and the remote trail.
This will allow you room to manage Golden Gate issues. While you fix
the issues, there is still sufficient storage for Golden Gate to keep on
shipping trail files.
123 1-6-2018
124 1-6-2018
62
01/06/2018
125 1-6-2018
126 1-6-2018
63
01/06/2018
End of Presentation
64