- About MDB
- Installation
- Upgrade
- Concepts
- User Interface
- Source Requirements
- Target Database Requirements
- Target Kafka Requirements
- Usage Restriction
- Frequently Exceptions
- Release Note
MogDB as a Source Database
Supported Version
Database version: 2.0 or later version
Dependency plug-in: wal2json
Note: MogDB is the source database and does not support object synchronization. Please set skipMigrationObject: ON as the advanced parameter of the channel.
Database Configuration
Install wal2json
For details, see wal2json.
Modify the WAL Parameter of the Source Database
Modify the parameter configuration file postgresql.conf
of the source database. The parameter file is located in the data/
directory of the database.
Use gsql to log in to the MogDB database. Run the following command to query the data directory:
gsql -d postgres -U $USER -c 'show data_directory'
Modify the postgresql.conf
file in the data/
directory.
# Relace <data_directory> with the actual data directory
vi <data_directory>/postgresql.conf
Find the following parameters in the postgresql.conf
file and set them to specified values.
- wal_level=logical #Use logical decoding to read pre-write logs.
- wal_sender_timeout = 0s #Customize the timeout.
Modify the HBA Configuration of the Source Database
In the data directory, find the pg_hba.conf
configuration file, add the following content to add the replication permission.
Note: mdb_user indicates the user for using the replication function. It needs to be modified based on actual requirement.
# Replace <data_directory> with the actual data directory.
cat >> <data_directory>/pg_hba.conf <"EOF"
# Add for MDB replication
host replication mdb_user 0.0.0.0/0 sha256
EOF
Set User Permission
Create the mdb_user user for logging in to and replicate source MogDB data. The username and password need to be modified based on the actual requirement.
- The login permission is used for logging in to the database.
- The replication permission is used for synchronizing incremental data.
- The sysadmin permission is used for initializing objects and synchronizing full data.
create user mdb_user with login replication sysadmin PASSWORD 'Enmo@123';
Enable the REPLICA IDENTITY Mode of the Table
For all tables to be synchronized, enable the REPLICA IDENTITY mode.
Note: The following is the command example.
ALTER TABLE public.customers REPLICA IDENTITY FULL;
Enable Heartbeat Configuration
Sending a heartbeat message enables the connector to send the latest retrieved LSN to the database slot, allowing the database to reclaim disk space used by WAL files that are no longer needed.
To enable the heartbeat configuration, see Channel-related Advanced Parameters. You need to set heartbeatIntervalMs
to a positive integer, and run the following command on the source node.
Note: The following is only an example. The table name heartbeat
needs to be consistent with the heartbeatTableName
value.
CREATE TABLE heartbeat (ts TIMESTAMP WITH TIME ZONE);
INSERT INTO heartbeat (ts) VALUES (NOW());
Character Set Mapping
Source Database | Target Database | Character Set of the Source Database | Character Set of the Target Database |
---|---|---|---|
MogDB | Oracle | BIG5 | ZHT16BIG5 |
MogDB | Oracle | EUC_JP | JA16EUC |
MogDB | Oracle | EUC_JIS_2004 | JA16EUCTILDE |
MogDB | Oracle | EUC_TW | ZHT32EUC |
MogDB | Oracle | GB18030 | ZHS32GB18030 |
MogDB | Oracle | GBK | ZHS16GBK |
MogDB | Oracle | ISO_8859_5 | CL8ISO8859P5 |
MogDB | Oracle | ISO_8859_6 | AR8ISO8859P6 |
MogDB | Oracle | ISO_8859_7 | EL8ISO8859P7 |
MogDB | Oracle | ISO_8859_8 | IW8ISO8859P8 |
MogDB | Oracle | JOHAB | KO16KSCCS |
MogDB | Oracle | KOI8R | CL8KOI8R |
MogDB | Oracle | KOI8U | CL8KOI8U |
MogDB | Oracle | LATIN1 | WE8ISO8859P1 |
MogDB | Oracle | LATIN2 | EE8ISO8859P2 |
MogDB | Oracle | LATIN3 | SE8ISO8859P3 |
MogDB | Oracle | LATIN4 | NEE8ISO8859P4 |
MogDB | Oracle | LATIN5 | WE8ISO8859P9 |
MogDB | Oracle | LATIN6 | NE8ISO8859P10 |
MogDB | Oracle | LATIN7 | BLT8ISO8859P13 |
MogDB | Oracle | LATIN8 | CEL8ISO8859P14 |
MogDB | Oracle | LATIN9 | WE8ISO8859P15 |
MogDB | Oracle | SJIS | JA16SJIS |
MogDB | Oracle | SHIFT_JIS_2004 | JA16SJISTILDE |
MogDB | Oracle | SQL_ASCII | US7ASCII |
MogDB | Oracle | UHC | KO16MSWIN949 |
MogDB | Oracle | UTF8 | AL32UTF8 |
MogDB | Oracle | WIN866 | RU8PC866 |
MogDB | Oracle | WIN1250 | EE8MSWIN1250 |
MogDB | Oracle | WIN1251 | CL8MSWIN1251 |
MogDB | Oracle | WIN1252 | WE8MSWIN1252 |
MogDB | Oracle | WIN1253 | EL8MSWIN1253 |
MogDB | Oracle | WIN1254 | TR8MSWIN1254 |
MogDB | Oracle | WIN1255 | IW8MSWIN1255 |
MogDB | Oracle | WIN1256 | AR8MSWIN1256 |
MogDB | Oracle | WIN1257 | BLT8MSWIN1257 |
MogDB | Oracle | WIN1258 | VN8MSWIN1258 |
MogDB | MySQL | UTF8 | UTF8 |
MogDB | MySQL | GBK | GBK |
MogDB | MySQL | BIG5 | BIG5 |
MogDB | MySQL | LATIN1 | LATIN1 |
MogDB | MySQL | LATIN2 | LATIN2 |
MogDB | MySQL | SJIS | SJIS |
MogDB | MySQL | EUC_KR | EUCKR |
MogDB | MySQL | KOI8U | KOI8U |
MogDB | MySQL | LATIN5 | LATIN5 |
MogDB | MySQL | LATIN7 | LATIN7 |
MogDB | MySQL | GB18030 | GB2312 |
MogDB | postgresql | BIG5 | BIG5 |
MogDB | postgresql | EUC_CN | EUC_CN |
MogDB | postgresql | EUC_JP | EUC_JP |
MogDB | postgresql | EUC_JIS_2004 | EUC_JIS_2004 |
MogDB | postgresql | EUC_KR | EUC_KR |
MogDB | postgresql | EUC_TW | EUC_TW |
MogDB | postgresql | GB18030 | GB18030 |
MogDB | postgresql | GBK | GBK |
MogDB | postgresql | Windows936 | Windows936 |
MogDB | postgresql | ISO_8859_5 | ISO_8859_5 |
MogDB | postgresql | ISO_8859_6 | ISO_8859_6 |
MogDB | postgresql | ISO_8859_7 | ISO_8859_7 |
MogDB | postgresql | ISO_8859_8 | ISO_8859_8 |
MogDB | postgresql | JOHAB | JOHAB |
MogDB | postgresql | KOI8R | KOI8R |
MogDB | postgresql | KOI8U | KOI8U |
MogDB | postgresql | LATIN1 | LATIN1 |
MogDB | postgresql | LATIN2 | LATIN2 |
MogDB | postgresql | LATIN3 | LATIN3 |
MogDB | postgresql | LATIN4 | LATIN4 |
MogDB | postgresql | LATIN5 | LATIN5 |
MogDB | postgresql | LATIN6 | LATIN6 |
MogDB | postgresql | LATIN7 | LATIN7 |
MogDB | postgresql | LATIN8 | LATIN8 |
MogDB | postgresql | LATIN9 | LATIN9 |
MogDB | postgresql | LATIN10 | LATIN10 |
MogDB | postgresql | MULE_INTERNAL | MULE_INTERNAL |
MogDB | postgresql | SJIS | SJIS |
MogDB | postgresql | SHIFT_JIS_2004 | SHIFT_JIS_2004 |
MogDB | postgresql | SQL_ASCII | SQL_ASCII |
MogDB | postgresql | UHC | UHC |
MogDB | postgresql | UTF8 | UTF8 |
MogDB | postgresql | WIN866 | WIN866 |
MogDB | postgresql | WIN874 | WIN874 |
MogDB | postgresql | WIN1250 | WIN1250 |
MogDB | postgresql | WIN1251 | WIN1251 |
MogDB | postgresql | WIN1252 | WIN1252 |
MogDB | postgresql | WIN1253 | WIN1253 |
MogDB | postgresql | WIN1254 | WIN1254 |
MogDB | postgresql | WIN1255 | WIN1255 |
MogDB | postgresql | WIN1256 | WIN1256 |
MogDB | postgresql | WIN1257 | WIN1257 |
MogDB | postgresql | WIN1258 | WIN1258 |