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.
- 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.
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.
- Go to the DMS console V5.0.
- In the top navigation bar, click Instances. . In the left-side navigation pane, click
- Click the Instance List tab.
- Find the database instance for which you want to enable the feature and choose Actions column. in the 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.
- In the Edit dialog box, click Advanced Information.
- 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.
- Click Submit.