OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

Product Overview
DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Database

SQL - V4.2.0

    Download PDF

    OceanBase logo

    The Unified Distributed Database for the AI Era.

    Follow Us
    Products
    OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
    Resources
    DocsBlogWhite PaperLive DemosTraining & CertificationTicket
    Company
    About OceanBaseTrust CenterLegalPartnerContact Us
    Follow Us

    © OceanBase 2026. All rights reserved

    Cloud Service AgreementPrivacy PolicySecurity
    Contact Us
    Document Feedback
    1. Documentation Center
    2. OceanBase Database
    3. SQL
    4. V4.2.0
    iconOceanBase Database
    SQL - V 4.2.0
    Databases
    • OceanBase Database
    • OceanBase Cloud
    • OceanBase Tugraph
    • Interactive Tutorials
    • OceanBase Best Practices
    Tools
    • OceanBase Cloud Platform
    • OceanBase Migration Service
    • OceanBase Developer Center
    • OceanBase Migration Assessment
    • OceanBase Admin Tool
    • OceanBase Loader and Dumper
    • OceanBase Deployer
    • Kubernetes operator for OceanBase
    • OceanBase Diagnostic Tool
    • OceanBase Binlog Service
    Connectors and Middleware
    • OceanBase Database Proxy
    • Embedded SQL in C for OceanBase
    • OceanBase Call Interface
    • OceanBase Connector/C
    • OceanBase Connector/J
    • OceanBase Connector/ODBC
    • OceanBase Connector/NET
    SQL
    KV
    • V 4.6.0
    • V 4.4.2
    • V 4.3.5
    • V 4.3.3
    • V 4.3.1
    • V 4.3.0
    • V 4.2.5
    • V 4.2.2
    • V 4.2.1
    • V 4.2.0
    • V 4.1.0
    • V 4.0.0
    • V 3.1.4 and earlier

    GV$ACTIVE_SESSION_HISTORY

    Last Updated:2023-12-08 07:13:36  Updated
    Share
    What is on this page
    Purpose
    Columns

    folded

    Share

    Purpose

    The GV$ACTIVE_SESSION_HISTORY view displays the active session history.

    Note

    This view is introduced since OceanBase Database V4.0.0.

    Columns

    Column
    Type
    Nullable?
    Description
    SVR_IP varchar(46) NO The IP address of the server to which the sample belongs.
    SVR_PORT bigint(20) NO The port number of the server to which the sample belongs.
    SAMPLE_ID bigint(20) NO The unique ID of the sample.
    SAMPLE_TIME datetime NO The sampling time.
    CON_ID bigint(20) NO The ID of the tenant.
    USER_ID bigint(20) NO The ID of the user whose session is sampled.
    SESSION_ID bigint(20) NO The ID of the sampled session.
    SESSION_TYPE varchar(10) NO The session type. Valid values:
  • FOREGROUND: foreground session, that is, user session.
  • BACKGROUND: background session, which is not supported for now.
  • SESSION_STATE varchar(7) NO The session status. Valid values:
  • ON CPU: The SQL logic is being executed without waiting.
  • WAITING: The session is waiting. For more information, see the EVENT column.
  • SQL_ID varchar(32) NO SQL ID
    PLAN_ID bigint(20) NO The plan ID of the sampled SQL statement in the plan cache, which is used to associate the sampling point with the plan.
    EVENT varchar(64) NO The description of the wait event.
    EVENT_NO bigint(20) NO The internal number of the wait event, which is used for join query with other tables.
    P1TEXT varchar(64) NO The name of the first parameter of the wait event. The parameter name varies with the event.
    P1 bigint(20) NO The value of the first parameter of the wait event.
    P2TEXT varchar(64) NO The name of the second parameter of the wait event. The parameter name varies with the event.
    P2 bigint(20) NO The value of the second parameter of the wait event.
    P3TEXT varchar(64) NO The name of the third parameter of the wait event. The parameter name varies with the event.
    P3 bigint(20) NO The value of the third parameter of the wait event.
    WAIT_CLASS varchar(64) NO The class of the wait event.
    WAIT_CLASS_ID bigint(20) NO The ID of the class of the wait event, which is used for join query with other tables.
    TIME_WAITED bigint(20) NO The total wait time of the wait event. Unit: us.
    SQL_PLAN_LINE_ID bigint(20) YES The ID of the SQL operator in the SQL plan when the session is being sampled.
    IN_PARSE varchar(1) NO Indicates whether the session is parsing an SQL statement during sampling.
    IN_PL_PARSE varchar(1) NO Indicates whether the session is parsing an SQL PL statement during sampling.
    IN_PLAN_CACHE varchar(1) NO Indicates whether the session is matching a plan cache during sampling.
    IN_SQL_OPTIMIZE varchar(1) NO Indicates whether the session is optimizing SQL parsing during sampling.
    IN_SQL_EXECUTION varchar(1) NO Indicates whether the session is executing an SQL statement during sampling.
    IN_PX_EXECUTION varchar(1) NO Indicates whether the session is executing SQL statements in parallel during sampling. If the session is in this state, it must also be in the state of SQL statement executing.
    IN_SEQUENCE_LOAD varchar(1) NO Indicates whether the session is generating values for an auto-increment column or a sequence during sampling.
    MODULE varchar(64) YES The MODULE value recorded during session sampling. The column value is always NULL.
    ACTION varchar(64) YES The ACTION value recorded during session sampling. The column value is always NULL.
    CLIENT_ID varchar(64) YES The CLIENT_ID value recorded during session sampling. The column value is always NULL.
    BACKTRACE varchar(512) YES An auxiliary debugging column, which records the code call stack when an event occurs. The column value is always NULL.

    Previous topic

    GV$SYSSTAT
    Last

    Next topic

    GV$DML_STATS
    Next
    What is on this page
    Purpose
    Columns