Add a third-party or self-managed database

更新时间:
复制 MD 格式

Data Management (DMS) supports adding third-party or self-managed databases to DMS, including databases with public IP addresses, ECS-hosted self-managed instances, databases connected via a database gateway, databases connected via a VPC gateway, and MyBase database instances. This topic describes how to add third-party or self-managed databases to DMS.

Prerequisites

Usage notes

  • To avoid errors, do not add spaces or other characters before or after the information you enter.

  • Databases exposed to the Internet are vulnerable to attacks. If you need to connect to your database over the Internet, add an IP address whitelist to improve its security.

  • If the instance source is a database gateway or a VPC PrivateLink, prepare the corresponding resources in advance.

  • When the instance source is MyBase Open Edition, you can only add MyBase on ACK instances.

Database account permissions

We recommend that you create a new database account to avoid sharing accounts that are already in use. The database account permissions are as follows:

  • To manage all databases in an instance, grant permissions for all databases of the entire instance.

  • To manage one or more databases in an instance, you can specify these databases in the authorization scope.

  • To perform operations such as creating, deleting, updating, and querying data in an instance, and modifying table structures, you need to grant the account sufficient DML and DDL permissions.

  • To perform operations on objects such as views, stored procedures, triggers, and functions, grant the account sufficient object operation permissions.

Procedure

In this example, the database is MySQL and the instance source is the Internet.

  1. Log in to DMS 5.0.

  2. In the Database Instances area on the left side of the console home page, click the Add Instanceadd icon.

    Note

    Alternatively, on the top menu bar, choose Data Assets > Instances and then click Add.

  3. On the Add Instance page, set Data Source to Third-party/Self-managed, and then configure the following parameters:

    Basic information

    Parameter

    Description

    Database type

    Select the database instance type. This example uses MySQL.

    Instance source

    DMS supports the following instance sources: Internet, ECS-hosted self-managed instance, database gateway, VPC PrivateLink, and MyBase. In this topic, Internet is selected.

    Instance region

    Select the region where the database instance is located.

    Login address

    Enter the corresponding address and instance ID based on the instance source. For example, if you set Instance Source to Internet, enter the public address (the Login Address).

    Note

    The configuration item labels differ depending on the instance source.

    Port

    Enter the service port of the target database.

    Access method

    Select whether to enable security hosting for the instance and how to log in to the database.

    After you enable security hosting for an instance, you can prevent users from directly accessing database accounts and passwords. You can also implement permission control at the instance, database, table, and row levels. For more information, see Security hosting.

    • Security Hosting - Manual: DMS automatically enables security hosting for the instance, but you need to manually enter an existing database account and password.

    • Not managed (Not recommended): If you select this option, you must frequently use your database account and password to log on. This may affect normal functionality.

    Database account

    Enter the login account for the target database. DMS uses this account to read, write, or perform other operations on the data. Provide an account with the required permissions.

    Database password

    Enter the password for the target database account.

    Advanced Feature Pack

    Select a feature pack based on your business requirements.

    • Security Collaboration or Stable Change (select one): Security Collaboration supports all capabilities of Stable Change and provides DevOps features for flexible customization of development and approval workflows. Stable Change provides solutions for more stable database operations, such as lock-free schema changes and SQL review. For more information, see Control modes.

      Note

      If you do not select the Security Collaboration or Stable Change feature packages, the instance defaults to Flexible Management mode.

    • Sensitive Data Protection: This feature allows you to govern and desensitize sensitive data. Enable this feature based on your business needs. For more information, see Enable Sensitive Data Protection.

    Security rules

    This parameter appears if you select the Security Collaboration feature pack.

    You can select system-default or custom security rules for fine-grained control over the database.

    Classification and grading template

    This parameter appears if you select the Sensitive Data Protection feature pack.

    You can bind a classification and grading template to an instance to identify whether fields in the instance's databases and tables match the identification rules in the template. Matching fields are then tagged with classification and grading labels to protect fields with high sensitivity levels.

    Advanced information

    Parameter

    Description

    Environment type

    Select the database environment type. For more information about instance environment types, see Instance environment types.

    Instance name

    You can customize the display name of an instance in DMS. When you add the database to DMS for the first time, DMS synchronizes the instance name from the database. After that, the name is no longer synchronized. You can maintain the instance name by editing the instance. For more information, see Edit an instance.

    Enable DBLink

    DMS enables DBLink for instances by default. If you do not specify a custom DBLink name, DMS automatically generates one for you. For more information, see Logical Data Warehouse.

    Lock-free Schema Change

    Note

    This option is available only for MySQL databases and allows you to select the change execution method when the instance is in Stable Change or Security Collaboration mode.

    DMS supports two schema change execution methods: DMS lock-free execution (default) and Native lock-free first (fallback to DMS).

    Enable SSL

    Note

    This parameter appears only for MySQL or Redis databases.

    By default, SSL connection is disabled in DMS.

    If you need to connect to the database over SSL, manually enable the SSL connection in DMS and ensure that SSL is also enabled on the database side.

    Secure Sockets Layer (SSL) encrypts network connections at the transport layer to improve the security and integrity of communication data, but it increases the network connection response time.

    DBA

    Select a DBA role for subsequent operations, such as requesting permissions, managing permissions, and approving tickets.

    Query timeout (s)

    This security policy helps protect the database by interrupting queries in the SQL window that exceed the specified timeout.

    Export timeout (s)

    This security policy helps protect the database by interrupting export tasks that exceed the specified timeout.

  4. After entering the required information, click Test Connection in the lower-left corner.

    Note

    If the connection test fails, review the instance information you entered and correct any errors based on the error message.

  5. When Connection successful is displayed, click Submit.

    The database has been successfully added to DMS. You can view and manage your database in the instance list on the left side of the DMS console.

Related operations

  • If you change the access mode from Security Hosting - Automatic to another mode and then change it back, DMS resets the password of the account that was first automatically generated.

  • To access resources in another Alibaba Cloud account's DMS or register your resources in another account's DMS, you must perform the cross-account access or registration operations.

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

  • Register an instance using the AddInstance API.

FAQ

  • Q: I added the DMS IP addresses to the whitelist of my Azure SQL Database, but I still receive the following error message when adding the database instance in the DMS console: Cannot open server "[Server Name]" requested by the login. The login failed. How can I resolve this?

    A: When you configure a New Instance, enter database account@server name in the database account field and try to reconnect. For example, if the public address of the Azure instance is testservername.testdatabase.windows.net and the database account is testuser, you need to enter testuser@testservername in the database account field.

  • Q: If the database to be added is an Oracle database deployed as a RAC cluster, how do I enter the SID parameter?

    A: In the SID parameter field, enter /<Service Name>.

  • Q: Is the Flexible Management mode no longer available in DMS?

    A: Yes. When the Stable Change and Security Collaboration modes are not selected, the instance defaults to the Flexible Management mode.

  • Q: I added a Redis instance to DMS over the internet, but now I can only see DB0 in DMS.

    A: After you add a Redis cluster from another cloud provider or a self-managed Redis cluster to DMS, DMS currently only supports displaying DB0.