Skip to content

SAP HANA

TwinCommit captures changes from SAP HANA by reading the HANA redo log through a log reader. Changes are grouped by transaction and applied at commit, in commit order. It works for S/4HANA, BW/4HANA and custom schemas, and installs no triggers or shadow tables.

Supported: SAP HANA 2.0 SPS 05 and later · SAP HANA Cloud · single-container and multi-tenant (MDC) systems.

The database must keep redo logs until they are backed up:

-- check
SELECT VALUE FROM M_INIFILE_CONTENTS
WHERE FILE_NAME = 'global.ini' AND SECTION = 'persistence' AND KEY = 'log_mode';
-- set (requires a full data backup afterwards)
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM')
SET ('persistence', 'log_mode') = 'normal' WITH RECONFIGURE;
CREATE USER TWINCOMMIT PASSWORD "********" NO FORCE_FIRST_PASSWORD_CHANGE;
ALTER USER TWINCOMMIT DISABLE PASSWORD LIFETIME;
GRANT LOG ADMIN TO TWINCOMMIT;
GRANT CATALOG READ TO TWINCOMMIT;
GRANT SELECT ON SCHEMA SAPHANADB TO TWINCOMMIT;

TwinCommit reads from log backups when it falls behind the online log. Keep log backups available on the backup catalog location for at least as long as your longest planned outage.

source:
type: saphana
host: hana-prod.internal
port: 30015
tenant: PRD
user: TWINCOMMIT
password: ${HANA_PASSWORD}
log_backup_path: /hana/backup/log/DB_PRD
  • The log reader decodes redo entries for the tables listed in tables: and reconstructs row images.
  • Transactions are released at commit; rolled-back transactions are discarded.
  • Snapshots use a consistent read at a recorded log position, then streaming resumes from that position.
  • Column-store and row-store tables are supported. Virtual tables and calculation views are not.
  • Tables without a primary key are not supported.
  • Changes made with IMPORT or ALTER TABLE ... LOAD that bypass the redo log mark the table as broken.