You can use the cross-database query feature of Data Management (DMS) to efficiently query data in databases and tables across multiple database instances. You can perform cross-database queries only on database instances for which the cross-database query feature is enabled. This topic describes how to enable the cross-database query feature for a database instance.

Prerequisites

  • The database instance runs one of the following database engines:
    • MySQL series: ApsaraDB RDS for MySQL, PolarDB for MySQL, MyBase for MySQL, PolarDB-X, AnalyticDB for MySQL V3.0, and other MySQL databases.
    • SQL Server series: ApsaraDB RDS for SQL Server, MyBase for SQL Server, and other SQL Server databases.
    • PostgreSQL series: ApsaraDB RDS for PostgreSQL, PolarDB for PostgreSQL, MyBase for PostgreSQL, AnalyticDB for PostgreSQL, and other PostgreSQL databases.
    • PolarDB for Oracle
    • ApsaraDB for Redis
  • The database instance runs in Security Collaboration control mode. For more information about how to change the control mode, see Configure the control mode of an instance.
  • You are a database administrator (DBA) or a DMS administrator. For more information about how to view the role of a user, see View owned system roles.

Procedure

Note To query data in databases and tables across multiple database instances, you must enable the cross-database query feature for each involved database instance.
  1. Go to the DMS console V5.0.
  2. In the top navigation bar, click Data Assets. In the left-side navigation pane, click Instances.
  3. Click the Instance List tab.
  4. Find the database instance for which you want to enable the feature and choose More > Edit in the Actions column.
    Note You can also click the Home tab in the top navigation bar of the DMS console. In the left-side navigation pane, right-click the database instance for which you want to enable the feature and select Edit.
  5. In the Edit dialog box, click Advanced Information.
  6. Select Enable DSQL and enter the name of a database link.
    Note
    • The name can contain only lowercase letters and underscores (_).
    • The name must be unique within a tenant.
  7. Click Submit.