Help Center/ Data Replication Service/ Troubleshooting/ Solutions to Failed Check Items/ Conflicts/ Checking Whether the Destination Database Contains Objects with the Same Name As Those in the Source Database
Updated on 2022-12-30 GMT+08:00

Checking Whether the Destination Database Contains Objects with the Same Name As Those in the Source Database

MySQL -> PostgreSQL Synchronization

Table 1 Checking whether the destination database contains objects with the same name as those in the source database

Check Item

Whether destination database contains objects with the same name as those in the source database

Description

The destination database contains objects with the same name as those in the source database. If a table of the same name exists in the destination database, the migration cannot be performed.

Failure Cause and Handling Suggestion

Failure cause: The source and destination database tables cannot have the same names.

Handling suggestions: Check whether the tables with the same names need to be retained. If yes, select another object for synchronization. If no, delete the tables with the same names.

Failure cause: The destination database contains the same table names as those of the synchronization objects.

Handling suggestions: Check whether the tables with the same names need to be retained. If yes, select another object for synchronization. If no, delete the tables with the same names.

Synchronization from Oracle to GaussDB(DWS)

Table 2 Checking Whether the Destination Database Contains Objects with the Same Name As Those in the Source Database

Check Item

Whether the destination database contains objects with the same name as those in the source database

Description

The destination database contains tables with the same name as those in the source database.

Failure Cause and Handling Suggestion

Failure cause: The destination database table does not exist and cannot be synchronized.

Handling suggestion: If you do not synchronize the table structure, create the table to be synchronized in the destination database in advance or synchronize the table structure.

Statement for creating a table in the destination database:

CREATE TABLE table_name (column_name data_type);

Oracle to GaussDB(DWS)/Oracle to PostgreSQL Synchronization

Table 3 Checking whether the destination database contains objects with the same name as those in the source database

Check Item

Whether the destination database contains objects with the same name as those in the source database

Description

The destination database contains objects with the same name as those in the source database.

Failure Cause and Handling Suggestion

Failure cause: The destination database contains the data and indexes of the table to be synchronized.

Handling suggestion: Delete data and indexes from the destination database table. Otherwise, data inconsistency may occur.

  • Statement for clearing data in a table:
    TRUNCATE TABLE table_name1;
  • Statement for deleting an index:
    DROP INDEX index_name ;

Failure cause: The source database contains encrypted objects.

Handling suggestion: Go back to the object selection page and select database objects that are not encrypted.

Failure cause: Source database names are the same except for letter cases.

Handling suggestion: Change the table name or return to the object selection page and deselect the tables with the same name. Statement for changing the table name:

ALTER TABLE old_table_name RENAME TO new_table_name;

Microsoft SQL Server as the Source in Synchronization

Table 4 Checking whether the destination database contains objects with the same name as those in the source database

Check Item

Whether the destination database contains objects with the same name as those in the source database

Description

The destination database contains objects with the same name as those in the source database.

  • If Table structure is selected, the destination database cannot contain objects with the same name as those in the source database.
  • If Table structure is not selected, create the corresponding table structure in the destination database in advance.

Failure Cause and Handling Suggestion

Failure cause: The destination database table does not exist and cannot be synchronized.

Handling suggestion: If you do not synchronize the table structure, create the table to be synchronized in the destination database in advance or synchronize the table structure.

Statement for creating a table in the destination database:

CREATE TABLE table_name (column_name data_type);

Failure cause: The table to be synchronized has been mapped to the destination database.

Handling suggestion: Return to the Set Synchronization Task page, select the tables that meet the requirements. Alternatively, change the mapping names of the tables to be synchronized.

Failure cause: The table to be synchronized has not been mapped to the destination database.

Handling suggestion: Select Table structure to create a database table, or create the corresponding table structure in the destination database. If the table structure was not missing, check whether the name of the mapped table is correct.

Table-Level Synchronization from PostgreSQL to PostgreSQL

Table 5 Checking whether destination database contains objects with the same name as those in the source database

Check Item

Whether destination database contains objects with the same name as those in the source database

Description

The destination database contains objects with the same name as those in the source database If the same object names exist, the migration cannot be performed.

Failure Cause and Handling Suggestion

Failure cause: The destination database contains objects with the same name as those in the source database.

Handling suggestions: Check whether the objects with the same names need to be retained. If yes, select another object for migration. If no, delete the objects with the same names.