All Products
Search
Document Center

PolarDB:V$SESSION

Last Updated:Mar 28, 2026

V$SESSION is a dynamic performance view in PolarDB for PostgreSQL (Compatible with Oracle) that displays session information for each current session in the database.

A session represents the connection between a user and the database. Each time a user logs on, the database creates a new session. Each row in V$SESSION represents a session that is active or recyclable.

Database administrators (DBAs) use V$SESSION to monitor connected users, diagnose session-level problems, analyze row lock contention, and identify sessions that consume the most resources.

Columns

The following table describes the columns in V$SESSION.

ColumnTypeDescription
SIDnumericSession identifier.
SERIAL#oidSerial number of the session. Similar to SID, it uniquely identifies the session.
USERNAMEcharacter varying(128)Name of the user in the session.
USER#oidInternal identifier of the user.
STATUScharacter varying(8)Current status of the session. See Status values.
SERVERcharacter varying(9)Server connection type. See Server values.
MACHINEtextName of the client machine.
PROGRAMcharacter varying(30)Name of the program that started the session.
TYPEtextSession type. See Type values.
SQL_IDcharacter varying(13)ID of the SQL statement currently being executed.
LAST_CALL_ETnumericElapsed time in seconds since the last calling.
LOGON_TIMEtimestamp with time zoneTime when the session logged on.
BLOCKING_SESSION_STATUStextWhether this session is being blocked by another session.
EVENTtextIf the session is currently waiting, the resource or event it is waiting on. If not in a wait, the resource or event most recently waited on.

Status values

The STATUS column reports one of the following values:

  • ACTIVE — The session is currently executing SQL.

  • INACTIVE — The session has no active SQL and is idle.

  • KILLED — The session has been marked for termination.

Server values

The SERVER column reports one of the following values:

  • DEDICATED — The session is connected through a dedicated server process.

  • SHARED — The session is connected through a shared server process.

Type values

The TYPE column reports one of the following values:

  • USER — A user session initiated by a client connection.

  • BACKGROUND — An internal background process session.