All Products
Search
Document Center

Data Transmission Service:Map object names

Last Updated:Sep 23, 2024

When you configure objects to be synchronized or migrated for a Data Transmission Service (DTS) task, you can use the object name mapping feature to rename the databases, tables, and columns that are synchronized or migrated to the destination instance. You can use this feature to specify the database or table to which data is synchronized or migrated in the destination instance. You can also create an object that has the same schema as a source object in the destination database and assign a different name to the object.

Scenarios

Scenario

Description

Create an object in the destination database to receive data.

  • Data migration task: You must select Schema Migration for the Migration Types parameter, and select at least one of Full Data Migration and Incremental Data Migration.

  • Data synchronization task: By default, Incremental Data Synchronization is selected for the Synchronization Types parameter. You must also select Schema Synchronization, and select Full Data Synchronization based on your business requirements.

Specify the objects in the destination database to receive data. For example, you want to synchronize or migrate data of multiple databases or tables to a single large database or table.

You must create an object in the destination database in advance to receive data and ensure data compatibility.

  • Data migration task: You do not need to select Schema Migration for the Migration Types parameter.

  • Data synchronization task: You do not need to select Schema Synchronization for the Synchronization Types parameter.

Create an object in the destination database.

This scenario is supported only for data migration tasks. You need to select only Schema Migration for the Migration Types parameter.

Prerequisites

The DTS task is in the Select Objects step and the object name mapping feature is needed. For more information about how to go to the Select Objects step, see the topics listed in Overview of data synchronization scenarios and Overview of data migration scenarios.

Note
  • We recommend that you select all supported migration or synchronization types for the Migration Types or Synchronization Types parameter. Otherwise, the migration or synchronization results may not meet your expectations.

  • If the previous version of the task configuration page is used, the DTS task must be in the Configure Objects and Advanced Settings step.

Limits

  • We recommend that you do not use the object name mapping feature after a DTS task is started. Otherwise, data loss may occur or the task may fail.

  • If the destination instance is a Tair or ApsaraDB for Redis instance, you can use only the database name mapping feature to select one or more databases from DB 0 to DB 255 to receive data.

  • If the type of the source database is Tair/Redis, you cannot map multiple names at a time.

  • If the type of the destination database is DataHub, you cannot use the database name mapping feature.

  • If the Database Type of the destination database is Kafka and you use the object name mapping feature to change the value of the Table Name parameter for the source table to the name of a topic in the destination database, the data in the table is written to the specified topic. Make sure that the Table Name parameter is set to the name of a topic that exists in the destination Kafka database. Otherwise, the DTS task fails.

  • If you select entire databases as objects to be synchronized or migrated, you can map only database names.

  • You can use the object name mapping feature for tables or columns in the following scenarios: The Database Type of the source database is MongoDB and collections are selected as the objects to be synchronized or migrated. The Database Type of the source database is Tair/Redis and databases are selected as the objects to be synchronized or migrated. The Database Type of the source database is not MongoDB or Tair/Redis and tables are selected as the objects to be synchronized or migrated.

  • If you use the object name mapping feature to rename an object, the objects that depend on the object may fail to be synchronized or migrated.

Map the name of a single object

  1. Move an object from the Source Objects section to the Selected Objects section.

  2. Open the Edit Table or Edit Schema dialog box.

    • In the Selected Objects section, right-click the object.

    • Move the pointer over the object and click Edit.

  3. In the dialog box that appears, set the object name that you want to use in the destination instance.

    Note
    • When you use the object name mapping feature for some instances, you can also add additional columns to a destination table or select the DDL and DML statements that you want to synchronize or migrate. The actual information displayed in the console prevails.

    • If you select different statements for database name mapping and table name mapping, the statements that are selected for table name mapping prevail.

    • In the Edit Table dialog box, you can specify conditions to filter data. For more information, see Specify filter conditions.

    • Database name mapping

      In the Edit Schema dialog box, set the database name that you want to use in the destination instance.

      Note

      If the types of the source and destination databases are both SQL Server, the Edit Database Name dialog box appears after you click Edit.

      image.png

    • Table name mapping

      In the Edit Table dialog box, specify the table name that you want to use in the destination database.

      image.png

    • Column name mapping

      In the Edit Table dialog box, clear Synchronize All Tables in the Column section and set the column names that you want to use in the destination instance.

      Note

      After you modify a column name, you can move the pointer over the image.png icon next to the column name to view the original name.

      image.png

  4. Click OK.

  5. Configure other parameters that are required for the DTS task.

Map multiple object names at a time

  1. Move multiple objects from the Source Objects section to the Selected Objects section.

  2. In the upper-right corner of the Selected Objects section, click Batch Edit.

  3. In the Batch Edit dialog box, map the names of databases, tables, and columns based on your business requirements.

    image

    1. Select the type of batch edit. In this example, Select All Databases and Tables is selected.

    2. In the Select Objects section, select the objects that you want to manage.

    3. Click the Object Name tab in the Select Editing Type section.

      Note

      When you use the batch mapping feature for some instances, you can also add additional columns to a destination table or select the DDL and DML statements that you want to synchronize or migrate. The actual information displayed in the console prevails.

    4. Select the scope of batch edit.

      • Edit Renamed Object Name: edits the names of databases, tables, and columns based on their renamed names.

      • Edit Original Name: edits the names of databases, tables, and columns based on their original names.

    5. Select one of the following rules and set the names of databases and tables based on the rule:

      • Add Prefix and Suffix: Select Add Prefix and Suffix from the Select Rule drop-down list and enter a prefix and suffix.

      • Change All Names: Select Change All Names from the Select Rule drop-down list and enter the new name.

      • Shorten All Names: Select Shorten All Names from the Select Rule drop-down list and enter the keyword that you want to remove from object names

    6. Click Apply to add a batch mapping rule.

    7. Click OK.

  4. Configure other parameters that are required for the DTS task.

Synchronize or migrate specific columns of a table

  1. Move the tables that you want to synchronize or migrate from the Source Objects section to the Selected Objects section.

  2. Right-click a table in the Selected Objects section.

  3. In the Column section of the Edit Table dialog box, clear Synchronize All Tables.

    image

  4. Deselect the columns that you do not want to synchronize or migrate.

  5. Click OK.

  6. Configure other parameters that are required for the DTS task.

FAQ

  • Q: How do I filter columns that do not need to be synchronized or migrated?

    A: Right-click a table in the Selected Objects section. In the Column section of the Edit Table dialog box, clear Synchronize All Tables and deselect the columns that do not need to be synchronized or migrated.

  • Q: Can I change the type of a column by using the column name mapping feature?

    A: No, you cannot change the type of a column by using the column name mapping feature.

  • Q: Can I modify a batch mapping rule after I add it?

    A: No, you cannot modify a batch mapping rule after you add it. You can click the image.png icon next to the rule to delete the rule. After the rule is deleted, add a new rule.

  • Q: Why am I unable to view the batch mapping rule after I configure it?

    A: You may not click Apply after you configure the rule, or you may accidentally delete the rule.