All Products
Search
Document Center

PolarDB:Create a database link from PolarDB for PostgreSQL(Compatible with Oracle) to PolarDB for PostgreSQL(Compatible with Oracle)

Last Updated:Mar 04, 2024

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

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region in which the cluster that you want to manage is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Databases.

  5. On the Databases page, click the DBLinks tab in the upper part.

  6. 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.

    Note

    You 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.

  7. Click OK.

Related operations

API

Description

CreateDBLink

Creates a database link for a PolarDB for PostgreSQL(Compatible with Oracle) cluster.

DescribeDBLinks

Queries the database link information of a PolarDB for PostgreSQL(Compatible with Oracle) cluster.