All Products
Search
Document Center

PolarDB:V$INSTANCE

Last Updated:Mar 28, 2026

V$INSTANCE is a dynamic performance view in PolarDB for PostgreSQL (Compatible with Oracle) that returns the current status of the database cluster. Query it to check whether the cluster is running, identify its role, and retrieve basic configuration details such as version and host name.

Querying V$INSTANCE requires a privileged account.

Columns

ColumnTypeDescription
INSTANCE_NUMBERnumericThe cluster number.
INSTANCE_NAMEcharacter varying (16)The cluster name, which is usually the same as the database name.
HOST_NAMEcharacter varying (16)The host name of the database cluster.
VERSIONcharacter varying (17)The database version.
STARTUP_TIMEdateThe time when the cluster was started.
STATUScharacter varying (12)The current status of the cluster, such as OPEN, MOUNTED, and STARTED.
PARALLELcharacter varying (3)Specifies whether the cluster is running in parallel mode.
THREAD#numericThe thread serial number of the cluster.
ARCHIVERcharacter varying (7)The archiving status of the cluster.
LOG_SWITCH_WAITcharacter varying (15)The event that log switching is waiting for.
DATABASE_STATUScharacter varying (17)The database status, such as ACTIVE and SUSPENDED.
INSTANCE_ROLEtextThe role of the cluster, such as PRIMARY INSTANCE and SECONDARY INSTANCE.

Usage example

Use the following query to check whether the cluster is running and available:

SELECT instance_name, status, database_status, instance_role
FROM V$INSTANCE;