PolarDB-O provides the database link (DBLink) feature for you to access data across databases.

For example, you can create a database link of Database B in Database A. Then, Database A can use the database link to access the data stored in Database B in the same way as Database A accesses its own data. In this case, two-way data access cannot be implemented. If Database B needs to access the data stored in Database A, you must create a database link of Database A in Database B.

Scenarios

PolarDB-O supports two types of database links: database links from some PolarDB-O clusters to other PolarDB-O clusters and database links from PolarDB-O to user-created Oracle databases hosted on Elastic Compute Service (ECS) instances.

  • Scenario 1: Database links from PolarDB-O to user-created Oracle databases hosted on ECS instances

    You previously used a user-created Oracle database that is hosted on an ECS instance. When you migrated the services to PolarDB-O, only part of the business systems were migrated to PolarDB-O due to some reasons. In this scenario, the remaining services are still deployed in the user-created Oracle database that is hosted on the ECS instance. Data access is required between the business systems that were migrated and the remaining services. Therefore, two-way data access must be implemented between the PolarDB-O database and the user-created Oracle database hosted on the ECS instance to ensure that your business runs as expected. To implement two-way data access, create a database link from the user-created Oracle database hosted on the ECS instance to PolarDB-O. You must also create a database link from PolarDB-O to the user-created Oracle database hosted on the ECS instance.

    Database link from PolarDB-O to a user-created Oracle database hosted on an ECS instance
  • Scenario 2: Database links from some PolarDB-O clusters to other PolarDB-O clusters

    Due to business requirements, you use two PolarDB-O clusters. Assume that the two clusters are PolarDB-O cluster A and PolarDB-O cluster B and the two clusters store data sets of different services. Two-way data access is required between the data sets of different services. To implement two-way data access between the two databases, create a database link from PolarDB-O cluster A to PolarDB-O cluster B and a database link from PolarDB-O cluster B to PolarDB-O cluster A.

    Database link from a PolarDB-O cluster to another PolarDB-O cluster