The invention relates to a method and a device for realizing synchronization of an oversized transaction to an openGauss
database based on Debezium. The method comprises the following steps: configuring the size of a file cache slice; starting an incremental synchronization service, and obtaining a data change
record (EVENT) by analyzing an
Oracle source
library log; dividing the EVENT into an independent file cache
queue according to the transaction ID, and triggering dynamic segmentation (the storage capacity exceeds the standard or is overtime); when the service is abnormal, positioning
a site through an index to realize
breakpoint resume; after the transactions are submitted, the file cache
queue is read in sequence and pushed to the downstream, and incomplete transactions are rolled back when the transactions are abnormal; events containing LOB /
XML columns are combined into DML statements, and the DML statements are issued according to a
primary key strategy; and converting the downstream
system into a standard format for the
consumer to subscribe. According to the scheme, memory caching is replaced by
file caching, OOM is avoided, dynamic segmentation and
breakpoint resume improve the large
transaction processing capacity, the LOB /
XML merging strategy guarantees the
data consistency, general transaction optimization is supported, and the oversized transaction synchronization efficiency and stability are remarkably improved.