All Products
Search
Document Center

Data Transmission Service:Map object names

Last Updated:Apr 18, 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 being configured and enters the Configure Objects and Advanced Settings step. For more information, see the topics listed in Overview of data synchronization scenarios and Overview of data migration scenarios.

Note

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

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 ApsaraDB for Redis Enhanced Edition (Tair), 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 you select entire databases as objects to be synchronized or migrated, you can map only database names.

  • You can use the table name mapping or column name mapping feature in the following cases: If the type of the source database is MongoDB, select collections as objects to be synchronized or migrated. If the type of the source database is ApsaraDB for Redis Enhanced Edition (Tair), select databases as objects to be synchronized or migrated. If the source database is of other types, select tables as 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. In the Configure Objects and Advanced Settings step, move the object that you want to synchronize or migrate to the Selected Objects section.

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

    • In the Selected Objects section, right-click the object that you want to manage.

    • 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 Name dialog box, you can also specify conditions to filter data. For more information, see Set 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 Name dialog box, set the table name that you want to use in the destination instance.

      image.png

    • Column name mapping

      In the Edit Table Name 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. In the Configure Objects and Advanced Settings step, move the objects that you want to synchronize or migrate 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.

FAQ

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

    A: In the Edit Table Name dialog box, clear Synchronize All Tables in the Column section. Then, clear 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 the rule is added. 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.