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.
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
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
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
).Open the configuration file.
$HOME/.bashrc
is used as an example:vim $HOME/.bashrc
At the end of the file, add the following line. Replace
{pwd}
with the absolute path to thepolardb-tools
folder.export PATH=$PATH:/{pwd}/polardb-tools/bin
Execute the following command to apply the changes.
source $HOME/.bashrc
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