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 database link from a PolarDB for PostgreSQL(Compatible with Oracle) cluster to a user-created 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 the PolarDB for PostgreSQL(Compatible with Oracle) cluster is the latest kernel version. For information about how to upgrade the kernel version, see Version Management.
Notes
You can create a maximum of 10 database links for each PolarDB for PostgreSQL(Compatible with Oracle) cluster. Each database link consumes one database link quota of both the source cluster and the destination cluster.
Procedure
- Log on to the PolarDB console.
- In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
- Find the cluster and click the cluster ID.
In the left-side navigation pane, choose .
On the Databases page, click the DBLinks tab in the upper part.
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 (_).
It must start with a lowercase letter and end with a letter or a digit.
It must be 1 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 is used as the fixed value. You cannot modify this parameter.
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
Enter the database name of the destination cluster. For more information about how to create a database, see Database management.
Click OK.
Related 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. |