All Products
Search
Document Center

PolarDB:PolarPlus

Last Updated:Mar 28, 2026

PolarPlus is a command-line interface (CLI) for PolarDB for PostgreSQL (Compatible with Oracle). If you're migrating from Oracle or managing PolarDB clusters in a terminal-driven workflow, PolarPlus provides the same SQL*Plus experience you're used to.

With PolarPlus, you can:

  • Run SQL queries and PL/SQL anonymous blocks

  • Execute stored procedures and functions

  • Format query output

  • Run batch scripts containing SQL and PolarPlus commands

  • Execute operating system commands

  • Log session output to a file

To manage your PolarDB cluster through a broader set of tools, see PolarDB-Tools. The psql tool included in PolarDB-Tools supports PL/SQL anonymous blocks, functions, and stored procedures using Oracle syntax.

Prerequisites

Before you begin, make sure your Linux system has the following installed:

  • Java Development Kit (JDK) 1.8 (64-bit)

  • OpenSSL 1.1 (64-bit)

Download PolarPlus

Download the package using wget:

wget https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20240708/riozpy/polarplus2_release.tar.gz
tar -xzf polarplus2_release.tar.gz

PolarPlus is a no-install tool. After extraction, the directory structure is:

polarplus2_release
├── polarplus2 -> ./polarplus2.sh
├── polarplus2.sh
├── polarplus.jar
├── login.sql
├── etc
│ └── sysconfig
├── help
└── lib

polarplus2 is the executable file (a symlink to polarplus2.sh). To run it from anywhere, add the polarplus2_release/ directory to your PATH environment variable.

Configure PolarPlus

  1. Open polarplus2.sh in a text editor.

  2. Set the base environment variable to the absolute path of the polarplus2_release directory:

    export base="/home/polarplus2_release"

    Replace /home/polarplus2_release with the actual absolute path on your system.

Connect to a database

Syntax

polarplus2 [ -S[ILENT] ] [ login | /NOLOG ] [ @scriptfile[.ext] ]
ArgumentDescription
-S[ILENT]Starts in silent mode, which suppresses the welcome banner and command prompts.
loginLogin credentials in the format username[/password][@{connectstring | variable}].
/NOLOGStarts PolarPlus without connecting to a database. Connect later using the CONNECT command.
@scriptfile[.ext]Path to a script file to run automatically at startup. The .sql extension can be omitted — PolarPlus uses .sql by default for files without a specified extension.

The connection string format is:

host[:port][/dbname][?ssl={true | false}]
ParameterDefaultDescription
hostLocal hostThe hostname or IP address of the database server.
port5444The port that accepts connections on the database server.
dbnamepolardbThe name of the database to connect to.
sslfalseSet to true to enable SSL. Must include host:port in the connection string when using SSL.

To connect using an IPv6 address, enclose the address in square brackets:

polarplus2 <username>/<password>@[fe80::20c:29ff:fe7c:78b2]:<port>/<database>

A variable defined in login.sql can also serve as the connection string.

Connect to your cluster

Run the following command to connect:

./polarplus2 <username>/<password>@<host>:<port>/<dbname>

Next steps