PolarDB for Oracle 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 for Oracle supports two types of database links: database links from some PolarDB for Oracle clusters to other PolarDB for Oracle clusters and database links from PolarDB for Oracle to user-created PostgreSQL databases hosted on Elastic Compute Service (ECS) instances.

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

    You previously used a user-created PostgreSQL database that is hosted on an ECS instance. When you migrated the services to PolarDB for Oracle, only part of the business systems were migrated to PolarDB for Oracle due to some reasons. In this scenario, the remaining services are still deployed in the user-created PostgreSQL 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 for Oracle database and the user-created PostgreSQL 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 PostgreSQL database hosted on the ECS instance to PolarDB for Oracle. You must also create a database link from PolarDB for Oracle to the user-created PostgreSQL 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 for Oracle clusters to other PolarDB for Oracle clusters

    Due to business requirements, you use two PolarDB for Oracle clusters. Assume that the two clusters are PolarDB for Oracle cluster A and PolarDB for Oracle 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 for Oracle cluster A to PolarDB for Oracle cluster B and a database link from PolarDB for Oracle cluster B to PolarDB for Oracle cluster A.

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