Help Center/ Data Replication Service/ FAQs/ Real-Time Migration/ Why Is the Collation of Heterogeneous or Oracle Databases Converted to utf8mb4_bin After Those Databases Are Migrated to MySQL?
Updated on 2022-07-19 GMT+08:00

Why Is the Collation of Heterogeneous or Oracle Databases Converted to utf8mb4_bin After Those Databases Are Migrated to MySQL?

Different databases support different types of character sets. After databases such as Oracle databases are migrated to the MySQL database, their encoding will be converted to the UTF8MB4 character set to support more bytes per character. The default collation of UTF8MB4 is utf8_general_ci, which is case insensitive. That is, abc and ABC are the same data. The migration from case-sensitive databases such as Oracle databases to MySQL databases may cause migration failures (primary key conflicts) or have impact on services (incorrect query results). You can refer to the following suggestions:

1. When DRS is used to perform heterogeneous migration or synchronization to MySQL, DRS automatically sorts the character set of the database (only the database to be migrated) with the utf8mb4_bin collation. This ensures that collation settings of new tables and columns in the same database are the same as those of the migrated tables and columns, facilitating associated queries and index queries.

2. You can set collation_server to utf8mb4_bin at the instance level. This setting ensures that the default character set of all instances is utf8mb4_bin, you can set this parameter based on service requirements.