Canonical: https://weaveos.com/reference/cockroachdb/inspect-active-sql-sessions

1. [Software capabilities](https://weaveos.com/reference)
2. /[CockroachDB](https://weaveos.com/reference/cockroachdb)
3. /Inspect active CockroachDB SQL sessions

[![](https://weaveos.com/reference/logos/cockroachdb.png)CockroachDB](https://weaveos.com/reference/cockroachdb)

# Inspect active CockroachDB SQL sessions

CockroachDB exposes current SQL sessions with SHOW CLUSTER SESSIONS and the DB Console Sessions page. The SQL statement is useful in scripts, while the console adds status filters and session details.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1CLI: cockroach sql --execute](https://weaveos.com/reference/cockroachdb/inspect-active-sql-sessions#method-1)
2. [2Interface: DB Console → Sessions](https://weaveos.com/reference/cockroachdb/inspect-active-sql-sessions#method-2)

CLI

### cockroach sql --execute

Run SHOW CLUSTER SESSIONS to list currently active sessions across all nodes, including transaction and statement details exposed by the result.

[Read source: CockroachDB SHOW SESSIONS](https://docs.cockroachlabs.com/docs/stable/show-sessions)

- Requirements

  The cockroach CLI and a secure SQL connection to the cluster. VIEWACTIVITY or VIEWACTIVITYREDACTED is required to see other users’ sessions.

- Limitations

  The statement reports currently active sessions and does not provide a historical session archive. VIEWACTIVITYREDACTED hides constants in other users' running queries.

Example shell

Copy

```
cockroach sql --url "$DATABASE_URL" --execute "SHOW CLUSTER SESSIONS"
```

Interface

### DB Console → Sessions

Open the Sessions page in DB Console to review active, idle, and closed sessions and drill into session details.

[Read source: CockroachDB Sessions page](https://docs.cockroachlabs.com/docs/stable/ui-sessions-page)

- Requirements

  A secure-cluster DB Console login with admin, VIEWACTIVITY, or VIEWACTIVITYREDACTED privilege to see all users' sessions. Other users see only their own sessions.

- Limitations

  The table excludes closed sessions by default. Closed-session details are retained only in a bounded in-memory cache controlled by capacity and time-to-live settings.

## More from CockroachDB

[View all 1 CockroachDB tasks](https://weaveos.com/reference/cockroachdb)
