The empty database initialization feature is provided by Data Management Service (DMS). It allows you to compare schemas of two databases, generate scripts for synchronizing data from the source database to the destination database, and run these scripts against the destination database. Note that destination databases must be empty databases. This topic describes how to use the empty database initialization feature.
- The empty database initialization feature only supports two database types: MySQL and ApsaraDB for OceanBase V1.0.
- Destination databases must be empty databases. That is, there must be no tables in destination databases.
- The empty database initialization feature allows you to synchronize some or all of the tables from a database, regardless of whether the database is a physical or logical database.
The empty database initialization feature is used to synchronize data between databases deployed across multiple regions or units, for example:
- Databases respectively deployed in the production and test environments.
- Databases deployed in the test environment.
- Databases deployed in the production environment.
Log on to the DMS console.
In the top navigation bar, choose Schemas > Table Sync > Empty Database Initialization.
On the Table/Database Synchronization Application page, set relevant parameters.
Parameter Description Source Database The name of the source database. You must have the read permission on the source database. Target Database The name of the destination database. You must have the write permission on the destination database. Initialized Table The tables that you want to synchronize. Valid values:
- Partial Tables: You can specify the source tables that you want to synchronize. The system will name the destination tables after the names of the source tables.
- All Tables
Whether to Ignore Error
- Not Ignore: If an error occurs when data is synchronized in the serial mode, the system will immediately stop running the current SQL script and the remaining SQL scripts.
- Ignore: If an error occur when the system is running an SQL script, the system will stop running the current SQL script and continue to run the next script until all remaining SQL scripts are run.
Click Submit. The system begins to conduct schema analysis.
Check the results of schema analysis.
If the schema of a table is changed, click Re-analyze in the ticket.
Check the scripts for synchronizing data from the source database to the destination database. If the scripts are correct, click Submit. Data will be synchronized to the destination database immediately.