All Products
Search
Document Center

PolarDB:PolarDB-Tools

Last Updated:Nov 19, 2024

This topic describes the components of PolarDB-Tools and how to download and install PolarDB-Tools.

Usage

PolarDB-Tools is a set of client tools for PolarDB. PolarDB-Tools is compatible with Linux operating systems, including Alibaba Cloud Linux, Rocky Linux, CentOS Stream, and CentOS. The following table describes the tools in PolarDB-Tools.

Tool

Description

Usage

Difference from the native tool

psql

A tool used to connect to a PostgreSQL database

Used in the same manner as the native psql tool. For more information, see psql on the PostgreSQL official website.

  • Adapted to PolarDB for PostgreSQL (Compatible with Oracle) to support Oracle-compatible syntax. If you use the community edition, unknown exceptions may occur.

  • If you need to execute only simple SQL statements to manage PolarDB clusters, you can use the community edition of the psql tool. Take note that the community edition of the psql tool does not allow you to create stored procedures. If you use the community edition of the psql tool to create stored procedures, SQL statements may be unexpectedly truncated.

  • To use the psql client, you can directly download the latest version of PolarDB-Tools. The latest version is compatible with older versions.

pg_dump

A tool used to back up a PostgreSQL database. You can use the pg_dump tool to back up a database in a cluster.

Used in the same manner as the native pg_dump tool. For more information, see pg_dump on the PostgreSQL official website.

  • PolarDB clusters allow you to back up data and redo logs in the PolarDB console. For more information, see Configure backup policies.

  • Adapted to PolarDB for PostgreSQL (Compatible with Oracle) to support Oracle-compatible syntax. If you use the community edition, specific objects may fail to be dumped.

  • To use the pg_dump tool, you can directly download the latest version of PolarDB-Tools. The latest version is compatible with older versions.

pg_restore

A tool used to restore a PostgreSQL database from backup files that are created by using pg_dump or pg_dumpall tool.

Used in the same manner as the native pg_restore tool. For more information, see pg_restore on the PostgreSQL official website.

  • PolarDB provides two methods for restoring historical data to a new cluster: restore data to a specific point in time and restore data from a backup set (snapshot). For more information, see Restoration methods.

  • Adapted to PolarDB for PostgreSQL (Compatible with Oracle) to support Oracle-compatible syntax. If you use the community edition, specific objects may fail to be restored.

  • To use the pg_restore client, you can directly download the latest version of PolarDB-Tools. The latest version is compatible with older versions.

ecpg

An embedded SQL preprocessor for C programs.

Used in the same manner as the native ecpg tool. For more information, see ecpg on the PostgreSQL official website.

  • Adapted to PolarDB for PostgreSQL (Compatible with Oracle) to support Oracle-compatible syntax. If you use the community edition, specific objects may fail to be converted.

  • To use the ecpg client, you can directly download the latest version of PolarDB-Tools. The latest version is compatible with older versions.

pg_repack

The client used to reclaim tablespaces.

For more information, see pg_repack.

  • The client is used in conjunction with the pg_repack client on the PolarDB for PostgreSQL (Compatible with Oracle) cluster side.

  • The version of the pg_repack client must be the same on the client and server sides. When you use the pg_repack client, download the version of PolarDB-Tools that matches the version of the client.

Download and installation

  1. Download the PolarDB-Tools installation package. The following table lists the download links for different operating system versions.

    Operating system version

    Processor architecture

    PolarDB minor database engine version

    pg_repack version

    PolarDB-Tools version

    PolarDB-Tools installation package

    AliOS 8/

    ALinux 3/

    Anolis 8/

    CentOS 8

    X86

    2.0.14.26.0

    1.5.1-1

    20241030

    PolarDB-Tools-2.0.14.26.0-20241023104506.al8.x86_64.rpm

    ARM

    2.0.14.26.0

    1.5.1-1

    20241030

    PolarDB-Tools-2.0.14.26.0-20241023104506.al8.aarch64.rpm

    AliOS 7/

    ALinux 2/

    Anolis 7/

    CentOS 7

    X86

    2.0.14.26.0

    1.5.1-1

    20241030

    PolarDB-Tools-2.0.14.26.0-20241023104506.alios7.x86_64.rpm

    ARM

    2.0.14.26.0

    1.5.1-1

    20241030

    PolarDB-Tools-2.0.14.26.0-20241023104506.alios7.aarch64.rpm

  2. Run the following installation command.

    yum install PolarDB-Tools-2.0.14.10.0-20230622222102.al8.x86_64.rpm	
    Note

    Replace the sample name used in the preceding command with the name of the installation package that you download.

    After the installation package is installed, the tools in PolarDB-Tools appear in the /u01/polardb_pg_tools/bin/ directory of the system.