All Products
Search
Document Center

Data Management:Register a database hosted on a third-party cloud service or a self-managed database

Last Updated:Mar 15, 2024

This topic describes how to register a database that is hosted on a third-party cloud service or a self-managed database with Data Management (DMS).

Prerequisites

  • The database that you want to register is supported by DMS. For more information about the types of databases hosted on third-party cloud services and self-managed databases that are supported by DMS, see the Supported self-managed databases and databases of third-party cloud service providers section of the "Databases supported by DMS" topic.

  • The IP address of the DMS server is added to the whitelist of a database hosted on a third-party cloud service or a self-managed database. For more information, see Configure an IP address whitelist.

  • One of the following network requirements is met for the database to be registered:

    • The database is accessible over the Internet.

    • The database is hosted on an Elastic Compute Service (ECS) instance.

    • The database is added to a database gateway. For more information, see Create a database gateway.

    • A network connectivity solution is purchased for the database. For more information about network connectivity solutions, see Connect a data center to a VPC.

Usage notes

  • To allow DMS users to manage database instances in the DMS console, you must grant permissions to the DMS users based on your business requirements. For more information about the syntax that you can use to grant permissions, see the official documentation of each type of database. The DMS users must have the following permissions:

    • To manage all the databases on an instance, a DMS user must have permissions on all the databases.

    • To manage one or more databases of an instance, a DMS user must have permissions on the specified databases.

    • To insert, delete, modify, and query data in an instance and change table schemas, a DMS user must have the required DML permissions.

    • To perform operations on objects, such as views, stored procedures, triggers, and functions in an instance, a DMS user must have the required permissions on these objects.

  • We recommend that you create a separate database account when you register a database instance.

  • To prevent interference, do not add spaces or special characters before or after the information that you enter when you register a database instance.

  • The database that is accessible over the Internet is vulnerable to attacks. If you want to access the database over the Internet, add the IP addresses that are used to access the database to the whitelist of the database to ensure database security.

  • If the database is added to a database gateway or resides in a virtual private cloud (VPC), prepare the relevant resources in advance.

Procedure

In this example, a MySQL database that is accessible over the Internet is registered with DMS.

  1. Log on to the DMS console V5.0.
  2. On the Home page of the DMS console, click the add icon next to Database Instances in the left-side navigation pane.

    Note

    Alternatively, choose Data Assets > Instances in the top navigation bar. On the Instance List tab of the Instances page, click New.

  3. In the Add Instance dialog box, configure the parameters that are described in the following table.

    Section

    Parameter

    Description

    Data Source

    N/A

    The source of the database instance. In this example, Third-party Cloud/Self-managed is selected.

    Basic Information

    Database Type

    The type of the database instance.

    Network Type

    The network type of the database instance. Valid values: Internet, ECS-hosted self-managed instance, Database Gateway, and VPC PrivateLink. In this example, Internet is selected.

    Instance Region

    The region in which the database instance resides.

    Login Address

    The IP address of the database or the ID of the instance that hosts the database.

    • If you set the Network Type parameter to Internet, you must enter the IP address of the database.

    • If you set the Network type parameter to ECS-hosted self-managed instance, you must enter the ID of the ECS instance.

    • If you set the Network Type parameter to Database Gateway, you must enter the ID and endpoint of the database gateway. For more information about how to obtain the ID and endpoint of a database gateway, see Create a database gateway.

    • If you set the Network Type parameter to VPC PrivateLink, you must enter the ID and endpoint of the VPC. For more information about how to obtain the ID and endpoint of a VPC, see Connect a data center to a VPC.

    Port

    The port that is used to connect to the database.

    Security hosting

    Specifies whether to enable security hosting for the database instance. Valid values:

    • Enable: If you enable security hosting for a database instance, you do not need to use a database account and password to log on to the database. You can manage permissions at the database instance, database, table, and row levels. For more information, see Security hosting.

    • Disable: If you disable security hosting for a database instance, you must use a database account and password every time you log on to the database if the logon session times out. This may affect the use of the database instance. We recommend that you do not set the Security hosting parameter to Disable.

    Database Account

    The account that is used to log on to the database. You can use the specified database account to perform operations such as read and write operations on the data of the database instance in DMS. You must specify a database account that has the required permissions.

    Database Password

    The password of the account that is used to log on to the database.

    Advanced Feature Pack

    Specifies the control mode in which the database instance is managed and whether to enable the sensitive data protection feature. Valid values:

    • Security Collaboration and Stable Change: The Security Collaboration mode supports all features that are included in the Stable Change mode and provides the DevOps feature to help you customize R&D processes and approval processes. The Stable Change mode provides solutions to allow databases to run more stably, such as lock-free changes and SQL review. You can select only one of the Security Collaboration and Stable Change modes. For more information, see Control modes.

      Note

      If you do not select the Security Collaboration or Stable Change mode, the database instance is managed in Flexible Management mode by default.

    • Sensitive Data Protection: This feature allows you to control and mask sensitive data. You can enable the feature based on your business requirements. For more information, see Enable the sensitive data protection feature.

    Security Rules

    The parameter appears if you set the Advanced Feature Pack parameter to Security Collaboration.

    You can select the default or custom security rules to implement fine-grained control on the database. For more information, see Manage security rules.

    Classification template

    This parameter appears if you set the Advanced Feature Pack parameter to Sensitive Data Protection.

    You can bind a classification and grading template to an instance to identify whether the fields in databases and tables in the instance comply with the identification rules of the template. If the fields comply with the identification rules, the fields are labeled for classification and grading to protect the fields with high sensitivity levels. For more information, see Manage DMS classification and grading templates.

    Advanced Information

    Environment type

    The type of the environment in which the database instance is deployed. For more information, see the Environment types section of the "Change the environment type of an instance" topic.

    Instance Name

    The name that you specify for the database instance. If you register a database instance for the first time, the name of the database instance is synchronized to DMS. DMS does not synchronize the name if the database instance is not registered for the first time. You can change the name of the database instance in the DMS console. For more information, see Modify database instances.

    Lock-free Schema Change

    Specifies whether to enable lock-free schema change. Valid values: Open (DMS OnlineDDL first), Open (MySQL Native OnlineDDL first), and Close. For more information, see Enable the lock-free schema change feature.

    Note

    This parameter appears only for a MySQL database instance.

    Enable SSL

    Note

    This parameter appears only for a MySQL or Redis database instance.

    Specifies whether to allow DMS to connect to the database instance by using SSL connections. By default, DMS does not connect to the database instance by using SSL connections.

    If you want to use SSL connections to connect to the database instance, set this parameter to Enable and make sure that the SSL encryption feature is enabled for the database instance.

    SSL encrypts network connections at the transport layer to improve the security and integrity of data in transmission. However, SSL increases the response time of network connections.

    DBA

    The database administrator (DBA) of the database instance. The DBA can grant permissions to users.

    Query Timeout(s)

    The timeout period for the execution of an SQL query statement. If the execution of an SQL query statement lasts longer than the specified timeout period, the execution of the statement is terminated to protect the database.

    Export Timeout(s)

    The timeout period for the execution of an SQL export statement. If the execution of an SQL export statement lasts longer than the specified timeout period, the execution of the statement is terminated to protect the database.

  4. After you configure the preceding parameters, click Test Connection in the lower-left corner.

    Note

    If the connection test fails, check the specified instance information based on the error message.

  5. If the connection test is passed, click Submit.

    After the preceding steps are performed, the database is registered with DMS. You can view and manage your database instance in the left-side database instance list of the DMS console.

What to do next

  • After you register a database instance with DMS, you can perform the following operations:

    • Manage the database instance, such as creating databases, creating tables in a database, and querying and modifying the table data. For more information, see Manage a database on the SQLConsole tab.

    • Change a large amount of data in a table without locking the table. You can perform this operation by using the lock-free DML feature of DMS. For more information, see Perform lock-free DML operations.

    • Export the table data. For more information, see Export data.

  • You can also call an API operation to register a database instance with DMS.

    For more information, see RegisterInstance.

FAQ

  • Q: The IP address of the DMS server is added to the whitelist of Azure SQL Database. However, when I register the database in the DMS console, the following error message appears. What do I do to resolve this issue?baocuoxinxi

    A: Enter Database Account@Server Name in the Database Account field in the Add Instance dialog box. Then, connect again. For example, if the public endpoint of the Azure instance is testservername.testdatebase.windows.net and the database account is testuser, you need to enter testuser@testservername in the Database Account field.

  • Q: Does DMS support the Flexible Management mode?

    A: Yes, DMS supports the Flexible Management mode. If you do not set the Advanced Feature Pack parameter to Stable Change or Security Collaboration when you register a database instance, the database instance is managed in the Flexible Management mode by default.