All Products
Search
Document Center

PolarDB:PolarDB-Tools

Last Updated:Dec 13, 2024

This topic describes the components of PolarTools and how to download and install PolarTools.

PolarTools is a set of PolarDB client tools for all versions of Alibaba Cloud Linux, Rocky Linux, CentOS Stream, and CentOS. PolarTools consists of the tools listed in the following table.

Note

We recommend that you use PolarTools to manage PolarDB for PostgreSQL (Compatible with Oracle) clusters.

The tools in PolarTools (such as psql and pg_dump) are different from those in PostgreSQL Community. The tools in PolarTools are adapted to PolarDB for PostgreSQL (Compatible with Oracle). Unknown exceptions may occur or incomplete data may be backed up or restored when you use the tools such as psql and pg_dump in PostgreSQL Community.

Tool

Description

Usage

psql

A client used to connect to PolarDB for PostgreSQL (Compatible with Oracle) clusters.

For more information, see psql at the PostgreSQL official site.

polarplus

A client tool that is used to connect to PolarDB databases. PolarPlus is compatible with Oracle syntax.

For more information, see PolarPlus.

pg_dump

A logical backup tool that backs up a database in a cluster.

For more information, see pg_dump.

pg_dumpall

A logical backup tool that backs up all databases in a cluster.

For more information, see pg_dumpall at the PostgreSQL official site.

pg_basebackup

A physical backup tool that backs up all data in a cluster.

For more information, see pg_basebackup at the PostgreSQL official site.

pg_restore

A restoration tool that restores the files that you back up by using pg_dump and pg_dumpall.

For more information, see pg_restore at the PostgreSQL official site.

Download and install PolarTools

  1. Download the PolarDB-Tools installation package from the following link: PolarDB-Tools.tar.gz. Then, decompress the downloaded package. The package is decompressed into the following directory structure:

    polardb-tools
    ├── bin
    │   ├── pg_basebackup
    │   ├── pg_dump
    │   ├── pg_dumpall
    │   ├── pg_restore
    │   └── psql
    ├── etc
    │   └── sysconfig
    ├── help
    ├── lib
    ├── login.sql
    ├── polarplus -> ./polarplus.sh
    ├── polarplus.jar
    └── polarplus.sh
  2. The bin folder in the PolarDB-Tools directory contains executable programs of the tools except for polarplus. You must configure the polarplus program before you use it. For more information, see PolarPlus.

    To use the tools, add the bin folder to the PATH environment variable by modifying the global environment variable configuration file (/etc/profile) or personal environment variable configuration files (such as /root/.bash_profile, /root/.bashrc, $HOME/.bash_profile, and $HOME/.bashrc).

    1. Open the configuration file. $HOME/.bashrc is used as an example:

      vim $HOME/.bashrc
    2. At the end of the file, add the following line. Replace {pwd} with the absolute path to the polardb-tools folder.

      export PATH=$PATH:/{pwd}/polardb-tools/bin
    3. Execute the following command to apply the changes.

      source $HOME/.bashrc
Note

If error messages similar to the following one is reported when you use the tools, your environment lacks necessary dynamic libraries. Install the required packages by using the yum install command to resolve this issue.

psql: error while loading shared libraries: libreadline.so.6: cannot open shared object file: No such file or directory