Oracle Heartbeats (CDB Multi-Tenant)
Setup Oracle heartbeats for low volume databases
For low volume Oracle sources using the Oracle LogMiner implementation (Streamkap's default), it is possible that the log becomes stale due to a lack of change events. As a result, events may not be captured by the Connector.
To address this, the heartbeat process involves writing an insert or update to a heartbeat table every 1 second to generate a change event.
Table must exist in a schema called streamkap
Setup Oracle Heartbeats
-- Create the streamkap schema
CREATE USER streamkap IDENTIFIED BY password;
GRANT CREATE SESSION TO streamkap;
ALTER USER streamkap DEFAULT TABLESPACE users QUOTA UNLIMITED ON users;
-- Connect as the streamkap user
CONNECT streamkap/password;
-- Create the heartbeat table with id, text, and last_update fields
CREATE TABLE streamkap_heartbeat (
id NUMBER GENERATED BY DEFAULT ON NULL AS IDENTITY PRIMARY KEY,
text VARCHAR2(4000),
last_update TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
-- Grant permission to the Streamkap user
GRANT INSERT, UPDATE ON streamkap_heartbeat TO STREAMKAP_USER;
-- Insert the first row into the heartbeat table
INSERT INTO streamkap_heartbeat (text) VALUES ('test_heartbeat');
Verify
- Look for entries in the heartbeat table to verify this is working with an updated timestamp
Updated about 2 months ago