This topic describes how to create a database link from a PolarDB for PostgreSQL (Compatible with Oracle) cluster to a PolarDB for PostgreSQL (Compatible with Oracle) cluster.
For more information about how to create a PolarDB for PostgreSQL (Compatible with Oracle) cluster to a self-managed Oracle database hosted on an Elastic Compute Service (ECS) instance, see Create a database link from PolarDB for PostgreSQL (Compatible with Oracle) to PostgreSQL.
Prerequisites
The source database and the destination database belong to the same Alibaba Cloud account.
The source database and the destination database are in the same region.
The kernel version of PolarDB for PostgreSQL (Compatible with Oracle) is the latest kernel version. For more information about how to upgrade the kernel version, see Version management.
Precautions
You can create a maximum of 10 database links for each PolarDB for PostgreSQL (Compatible with Oracle) cluster can create a maximum of 10 database links. Each database link consumes one database link quota of both the source cluster and the destination cluster.
Procedure
Log on to the PolarDB console. Click Clusters in the left-side navigation pane. Select a region in the upper-left corner and click the ID of the cluster in the list to go to the Basic Information page.
In the left-side navigation pane, choose .
On the Databases page, click the DBLinks tab.
NoteIf the DBLinks tab is not displayed on the Databases page of your PolarDB cluster, see the instructions in Network channels to enable it.
Click Create DBLink and configure the following parameters.
Parameter
Description
DBLink Name
You can enter a custom name of the database link. The name must meet the following requirements:
The name must contain lowercase letters and can contain digits and underscores (_).
The name must start with a lowercase letter and end with a lowercase letter or a digit.
The name can be up to 64 characters in length.
This name is required when you use the database link for cross-database queries.
Source Instance Name
The name of the current PolarDB for PostgreSQL (Compatible with Oracle) cluster. The value is fixed and cannot be modified.
Source Database Name
Select a database in the current PolarDB for PostgreSQL (Compatible with Oracle) cluster from the drop-down list.
Destination Instance
Select a destination cluster for the database link from the drop-down list.
NoteYou can only select a cluster deployed in the same region as the source cluster.
Destination Account
The account that is used to access the destination cluster. For more information about how to create an account, see Create a database account.
Destination Account Password
The password of the account that is used to access the destination cluster.
Destination Database Name
The database name of the destination cluster. For more information about how to create a database, see Database management.
Click OK.
Related API operations
API | Description |
Creates a database link for a PolarDB for PostgreSQL (Compatible with Oracle) cluster. | |
Queries the database link information of a PolarDB for PostgreSQL (Compatible with Oracle) cluster. |