4 Automatic Heartbeat for Big Data
This chapter describes how to enable Heartbeat for Oracle GoldenGate for Big Data and how to manage and modify heartbeat across the replication environment.
4.1 Overview
HEARTBEATTABLE
for Oracle GoldenGate for BigData,
you need to:
- Specify
GGSCHEMA
inGLOBALS
with any value, for example,GGSCHEMA GGADMIN
. - Execute
ADD HEARTBEATTABLE
fromGGSCI
.
In Oracle GoldenGate for RDBMS, the HEARTBEATTABLE
records
are applied to the following target HEARTBEATTABLE
tables:
GGADMIN.GG_HEARTBEAT
and
GGADMIN.GG_HEARBEAT_HISTORY
.
Two Modes of HEARTBEATTABLE
in Oracle GoldenGate for Big
Data
HEARTBEATTABLE
files. For example,
Table
GGADMIN.GG_HEARTBEAT
is stored in file
dirtmp/<replicat name>-hb.json
. Here, the records are
written to the replicat file hb.json
.
Table
GGADMIN.GG_HEARTBEAT_HISTORY
is stored in
dirtmp/<replicat-name>-hb-<date>.json
. Here, the
History records re written to the hb-<date>.json
file.
Mode 2 is passthrough that enables you to send a statement directly to a non-Oracle system, such as Kafka without first being interpreted by Big Data.
HEARTBEATTABLE
as user data:
- Disable
HEARTBEATTABLE
by specifyingDISABLEHEARTBEATTABLE
in the replicat parameter file. - Specify
HEARTBEATTABLE
tables in the replicatMAP
statements:MAP GGADMIN.GG_HEARTBEAT, TARGET GGADMIN.GG_HEARTBEAT; MAP GGADMIN.GG_HEARTBEAT_HISTORY, TARGET GGADMIN.GG_HEARTBEAT_HISTORY;
When applied as user data, the
HEARTBEAT
recordsGG_HEARTBEAT
andGG_HEARTBEAT_HISTORY
are written to the handler as if they are user tables. TheHEARTBEAT
records are not stored in tables like RDBMS, but in.json
files.
4.2 Automatic Heartbeat Tables
4.2.1 ADD HEARTBEATTABLE
ADD HEARTBEATTABLE
[, RETENTION_TIME number in days] |
[, PURGE_FREQUENCY number in days]
- RETENTION_TIME
-
Specifies when heartbeat entries older than the retention time in the history table are purged. The default is 30 days.
- PURGE FREQUENCY
-
Specifies how often the purge scheduler is run to delete table entries that are older than the retention time from the heartbeat history. The default is 1 day.
GGSCI > ADD HEARTBEATTABLE HEARTBEAT is now enabled: HEARTBEAT configuration file in dirprm\heartbeat.properties heartbeat.enabled=true heartbeat.frequency=60 heartbeat.retention_time=30 heartbeat.purge.frequency=1 heartbeat.db.name=BigData
4.2.2 ALTER HEARTBEAT TABLE
ALTER HEARTBEATTABLE
[, RETENTION_TIME number in days] |
[, PURGE_FREQUENCY number in days]
4.2.3 INFO HEARTBEATTABLE
Example
HEARTBEAT configuration file dirprm\heartbeat.properties heartbeat.enabled=true heartbeat.frequency=60 heartbeat.retention_time=30 heartbeat.purge.frequency=1 heartbeat.db.name=BigData
4.2.4 LAG
LAG <replicat name>
Example
GGSCI> LAG rtpc Lag Information From Heartbeat Table LAG AGE FROM TO PATH 5.77s 10m 22.87s ORCL BIGDATA ETPC ==> PTPC ==> RTPC
LAG <replicat name> HISTORY
GGSCI> LAG rtpc HISTORY
Example
Lag Information From Heartbeat Table
LAG AGE FROM TO PATH
5.77s 10m 22.87s ORCL ORCL ETPC ==> PTPC ==> RTPC
Lag History
DATE MIN AVG MAX
2018-07-01 5.77s 5.90s 6.20s
2018-07-02 6.77s 6.90s 7.20s
2018-07-03 7.77s 7.90s 8.20s
2018-07-04 8.77s 9.90s 9.20s