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). It lets you run SQL statements, PL/SQL anonymous blocks, functions, and stored procedures directly from the terminal without installing a database client.

With PolarPlus, you can:

  • Query database objects

  • Execute stored procedures

  • Format SQL output

  • Run batch processing scripts

  • Run OS commands

  • Record session output

To manage PolarDB clusters with a more fully integrated toolset, use PolarDB-Tools. Its psql tool supports Oracle-compatible PL/SQL anonymous blocks, functions, and stored procedures.

Prerequisites

Before you begin, make sure you have:

  • Java Development Kit (JDK) 1.8 for 64-bit operating systems

  • OpenSSL 1.1 for 64-bit operating systems

  • A Linux environment (PolarPlus runs on Linux only)

Download PolarPlus

PolarPlus ships as a no-install package. Download and decompress it — no installation step is needed.

wget https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20241204/eozaey/polarplus_release.tar.gz
tar -xzf polarplus_release.tar.gz

After decompression, the directory looks like this:

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

The polarplus file is the executable entry point. To run it from anywhere, add polarplus_release/ to your PATH:

export PATH="$PATH:/path/to/polarplus_release"

Configure PolarPlus

Before starting PolarPlus, set the base path in the startup script:

  1. Open polarplus.sh.

  2. Find the line export base="{pwd}/polarplus" and replace {pwd} with the absolute path to the polarplus file.

Connect to a database

Startup syntax

Start PolarPlus with the following command:

polarplus [-S[ILENT]] [<login> | /NOLOG] [@<scriptfile>[.<ext>]]

The three components map to distinct modes of operation:

Options

OptionDescription
-S[ILENT]Suppresses the logon banner and connection messages.

Logon

<username>[/<password>][@{<connectstring> | <variable>}]
ParameterDescription
usernameThe database account name.
passwordThe database account password.
connectstringThe connection string. See Connection string format.
variableA variable defined in login.sql. This file stores your connection string and loads automatically on startup.

Start (script file)

@<scriptfile>[.<ext>]

PolarPlus runs the SQL statements and commands in this file automatically on startup.

ParameterDescription
scriptfileA script file in the current working directory. If the file extension is .sql, you can omit it. Files without an extension are treated as .sql. Name your script files as <filename>.<extension> — PolarPlus cannot access files that have no extension in the filename.

`/NOLOG`

Use /NOLOG to start PolarPlus without connecting to a database. This is useful when you want to edit scripts or run PolarPlus commands before establishing a connection. To connect after startup, run the CONNECT command.

Connection string format

<host>[:<port>][/<dbname>][?ssl={true|false}]
ParameterDescription
hostThe hostname or IP address of the database server. Defaults to the on-premises host if omitted.
portThe port the database server listens on. Defaults to 5444 if omitted.
dbnameThe name of the database to connect to. Defaults to polardb if omitted.
?ssl=trueEnables SSL. Must be used together with host:port.

For IPv6 addresses, wrap the address in brackets:

polarplus polardb/password@[fe80::20c:29ff:fe7c:78b2]:5444/polardb

Connect to a PolarDB database

polarplus polardb/password@pc-bp1zxxxxxxxxxxx.o.polardb.rds.aliyuncs.com:1521/polardb

Version compatibility

PolarPlus connects to PolarDB for PostgreSQL (Compatible with Oracle) 1.0 clusters only. Use PolarPlus2 for 2.0 clusters.

Cluster versionClientDownload
PolarDB for PostgreSQL (Compatible with Oracle) 1.0PolarPluspolarplus_release.tar.gz
PolarDB for PostgreSQL (Compatible with Oracle) 2.0PolarPlus2polarplus2_release.tar.gz

PolarPlus2 has the same directory structure and usage as PolarPlus. Replace polarplus with polarplus2 in all paths and commands.