To query data across databases using Foreign Data Wrapper (FDW) external tables, dblink, or database link, your PolarDB for PostgreSQL (Compatible with Oracle) cluster must have private network connectivity to the target database. A network channel establishes this connectivity between your cluster and a self-managed PostgreSQL or Oracle database hosted on an ECS instance.
Prerequisites
Before you begin, make sure you have:
-
A self-managed PostgreSQL or Oracle database on an ECS instance
-
The ECS instance deployed in a virtual private cloud (VPC)
-
The PolarDB cluster and the ECS-hosted self-managed database under the same Alibaba Cloud account
-
The PolarDB cluster and the ECS-hosted self-managed database in the same region
Create a network channel
Each PolarDB for PostgreSQL (Compatible with Oracle) cluster supports up to three network channels per region.
-
Log on to the PolarDB console. In the left-side navigation pane, click Clusters. Select a region in the upper-left corner, then click the cluster ID to go to the Basic Information page.
-
In the left-side navigation pane, choose Settings and Management > Databases.
-
On the Databases page, click the Network Channels tab.
-
Select Network Channels to Self-managed Databases.
-
Click Create Network Channels to Self-managed Databases and set the following parameters.
Parameter Description Channel name A name for the network channel. The name must consist of lowercase letters and can include digits and underscores (_). It must start and end with a lowercase letter or a digit, and can be up to 64 characters in length. This name is required when you run cross-database queries. Source instance name The name of the current PolarDB cluster. This value is fixed and cannot be modified. Region of destination instance The region where the ECS instance resides, such as cn-hangzhou. This value is fixed to the region of the current PolarDB cluster. To find the region ID, go to the ECS console or call the DescribeInstances API.VPC of destination instance The VPC where the ECS instance resides. To find the VPC ID, go to the ECS console, open the Instance Details page of the ECS instance, and look in the Configuration Information section. VPC ID of destination instance The private IP address of the ECS instance. To find it, go to the ECS console, open the Instance Details page, and look for the primary private IP address in the Configuration Information section. VPC port of destination instance The port that the self-managed database listens on. Remarks The remarks for the network channel. -
Click OK.