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.3.1

    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.3.1
    iconOceanBase Database
    SQL - V 4.3.1
    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

    Query the details of a session

    Last Updated:2026-04-15 08:25:14  Updated
    Share
    What is on this page
    Procedure

    folded

    Share

    This topic describes how to query the detailed internal status of a specified client session on OceanBase Database Proxy (ODP).

    Procedure

    You can use the SHOW PROXYSESSION ATTRIBUTE statement in the sys tenant or a user tenant to query the detailed internal status of a specified client session on ODP, including the server session involved in the client session.

    1. Connect to OceanBase Database by using ODP.

      Here is an example:

      obclient -h10.xx.xx.xx -uusername@obtenant#obdemo -P2883 -p****** -c -A oceanbase
      

      For more information about how to connect to OceanBase Database by using ODP, see Connect to a MySQL tenant of OceanBase Database by using OBClient and Connect to an Oracle tenant of OceanBase Database by using OBClient.

    2. Query the detailed internal status of the specified client session.

      The SQL syntax is as follows:

      SHOW PROXYSESSION ATTRIBUTE [id [LIKE 'xxx']]
      

      The parameters are described as follows:

      • If id is not specified, the details of the current session are returned. This query method is supported for ODP V1.1.0 and later. You can also query the value of a specified attribute of the current session in fuzzy match mode. This query method is supported for ODP V1.1.2 and later.

      • If id is specified, you can query the value of a specified attribute of a specified session in fuzzy match mode. This query method is supported for ODP V1.1.0 and later.

      • In the statement, id can be replaced with cs_id or connection_id. These parameters are equivalent

        cs_id indicates the ID of a client session in ODP. connection_id indicates the ID of a client session in OceanBase Database.

        You can obtain the connection_id value by using the SELECT CONNECTION_ID(); statement in MySQL mode and the SHOW FULL PROCESSLIST; statement in Oracle mode.

      • The LIKE option supports fuzzy matches. Percent signs (%) and underscores (_) are supported.

      Here is an example:

      MySQL mode
      Oracle mode
      1. Query the details of the specified client session.

        SHOW PROXYSESSION ATTRIBUTE;
        

        The query result is as follows:

        +----------------------------------+----------------------+----------------+
        | attribute_name                   | value                | info           |
        +----------------------------------+----------------------+----------------+
        | proxy_sessid                     | -6044239443189891054 | cs common      |
        | cs_id                            | 65160                | cs common      |
        | cluster                          | test420              | cs common      |
        | tenant                           | mysql001             | cs common      |
        | user                             | root                 | cs common      |
        | host_ip                          | 100.xx.xx.xx         | cs common      |
        | host_port                        | 48056                | cs common      |
        | db                               | NULL                 | cs common      |
        | total_trans_cnt                  | 0                    | cs common      |
        | svr_session_cnt                  | 1                    | cs common      |
        | active                           | true                 | cs common      |
        | read_state                       | MCS_ACTIVE_READER    | cs common      |
        | tid                              | 76286                | cs common      |
        | pid                              | 76286                | cs common      |
        | idc_name                         |                      | cs common      |
        | modified_time                    | 0                    | cs stat        |
        | reported_time                    | 0                    | cs stat        |
        | hot_sys_var_version              | 0                    | cs var version |
        | sys_var_version                  | 2                    | cs var version |
        | user_var_version                 | 0                    | cs var version |
        | last_insert_id_version           | 0                    | cs var version |
        | db_name_version                  | 0                    | cs var version |
        | server_ip                        | 172.xx.xx.xx         | last used ss   |
        | server_port                      | 2881                 | last used ss   |
        | server_sessid                    | 3221597019           | last used ss   |
        | ss_id                            | 22                   | last used ss   |
        | state                            | MSS_KA_CLIENT_SLAVE  | last used ss   |
        | transact_count                   | 4                    | last used ss   |
        | server_trans_stat                | 0                    | last used ss   |
        | hot_sys_var_version              | 0                    | last used ss   |
        | sys_var_version                  | 2                    | last used ss   |
        | user_var_version                 | 0                    | last used ss   |
        | last_insert_id_version           | 0                    | last used ss   |
        | db_name_version                  | 0                    | last used ss   |
        | is_checksum_supported            | 1                    | last used ss   |
        | is_safe_read_weak_supported      | 0                    | last used ss   |
        | is_checksum_switch_supported     | 1                    | last used ss   |
        | checksum_switch                  | 1                    | last used ss   |
        | enable_extra_ok_packet_for_stats | 1                    | last used ss   |
        +----------------------------------+----------------------+----------------+
        39 rows in set
        
      2. Query details of specified attributes through fuzzy search.

        SHOW PROXYSESSION ATTRIBUTE 65160 like '%id%';
        

        The query result is as follows:

        +------------------------+----------------------+----------------+
        | attribute_name         | value                | info           |
        +------------------------+----------------------+----------------+
        | proxy_sessid           | -6044239443189891054 | cs common      |
        | cs_id                  | 65160                | cs common      |
        | tid                    | 76286                | cs common      |
        | pid                    | 76286                | cs common      |
        | idc_name               |                      | cs common      |
        | last_insert_id_version | 0                    | cs var version |
        | server_sessid          | 3221597019           | last used ss   |
        | ss_id                  | 22                   | last used ss   |
        | last_insert_id_version | 0                    | last used ss   |
        +------------------------+----------------------+----------------+
        9 rows in set
        
      1. Query the details of the specified client session.

        SHOW PROXYSESSION ATTRIBUTE;
        

        The query result is as follows:

        +----------------------------------+----------------------+----------------+
        | attribute_name                   | value                | info           |
        +----------------------------------+----------------------+----------------+
        | proxy_sessid                     | -6044239443189891058 | cs common      |
        | cs_id                            | 65141                | cs common      |
        | cluster                          | test420              | cs common      |
        | tenant                           | oracle001            | cs common      |
        | user                             | sys                  | cs common      |
        | host_ip                          | 100.xx.xx.xx         | cs common      |
        | host_port                        | 59648                | cs common      |
        | db                               | SYS                  | cs common      |
        | total_trans_cnt                  | 0                    | cs common      |
        | svr_session_cnt                  | 1                    | cs common      |
        | active                           | true                 | cs common      |
        | read_state                       | MCS_ACTIVE_READER    | cs common      |
        | tid                              | 76286                | cs common      |
        | pid                              | 76286                | cs common      |
        | idc_name                         |                      | cs common      |
        | modified_time                    | 0                    | cs stat        |
        | reported_time                    | 0                    | cs stat        |
        | hot_sys_var_version              | 1                    | cs var version |
        | sys_var_version                  | 10                   | cs var version |
        | user_var_version                 | 0                    | cs var version |
        | last_insert_id_version           | 0                    | cs var version |
        | db_name_version                  | 1                    | cs var version |
        | server_ip                        | xx.xx.xx.xx          | last used ss   |
        | server_port                      | 2881                 | last used ss   |
        | server_sessid                    | 3221583071           | last used ss   |
        | ss_id                            | 18                   | last used ss   |
        | state                            | MSS_KA_CLIENT_SLAVE  | last used ss   |
        | transact_count                   | 4                    | last used ss   |
        | server_trans_stat                | 0                    | last used ss   |
        | hot_sys_var_version              | 1                    | last used ss   |
        | sys_var_version                  | 10                   | last used ss   |
        | user_var_version                 | 0                    | last used ss   |
        | last_insert_id_version           | 0                    | last used ss   |
        | db_name_version                  | 1                    | last used ss   |
        | is_checksum_supported            | 1                    | last used ss   |
        | is_safe_read_weak_supported      | 0                    | last used ss   |
        | is_checksum_switch_supported     | 1                    | last used ss   |
        | checksum_switch                  | 1                    | last used ss   |
        | enable_extra_ok_packet_for_stats | 1                    | last used ss   |
        +----------------------------------+----------------------+----------------+
        39 rows in set
        
      2. Query details of specified attributes through fuzzy search.

        SHOW PROXYSESSION ATTRIBUTE 65141 LIKE '%id%';
        

        The query result is as follows:

        +------------------------+----------------------+----------------+
        | attribute_name         | value                | info           |
        +------------------------+----------------------+----------------+
        | proxy_sessid           | -6044239443189891058 | cs common      |
        | cs_id                  | 65141                | cs common      |
        | tid                    | 76286                | cs common      |
        | pid                    | 76286                | cs common      |
        | idc_name               |                      | cs common      |
        | last_insert_id_version | 0                    | cs var version |
        | server_sessid          | 3221583071           | last used ss   |
        | ss_id                  | 18                   | last used ss   |
        | last_insert_id_version | 0                    | last used ss   |
        +------------------------+----------------------+----------------+
        9 rows in set
        

      The following table describes the fields in the returned result.

      Field
      Description
      attribute_name The attribute name.
      value The attribute value.
      info The basic information.

      The following table describes the general attributes.

      Field
      Description
      proxy_sessid The session ID of the ODP.
      cs_id The ID used by ODP to identify a client.
      cluster The name of the cluster to which the client session belongs.
      tenant The tenant.
      user The user.
      host_ip The IP address of the user.
      host_port The port number of the user.
      db The database.
      total_trans_cnt The total number of transmitted transactions.
      svr_session_cnt The total number of sessions.
      active Indicates whether the session is active.
      read_state The status of the client session.
      tid The thread ID.
      pid The process ID.
      modified_time The time when the session was modified.
      reported_time The time when the session was reported.
      hot_sys_var_version The version of the system variable that is updated in real time.
      sys_var_version The system variable version.
      user_var_version The user variable version.
      last_insert_id_version The last inserted ID version.
      db_name_version The database name version.
      server_ip The IP address of the OBServer node.
      server_port The port number of the OBServer node.
      server_sessid The session ID of the OBServer node.
      ss_id The ID used by ODP to identify a server session.
      state The network connectivity.
      transact_count The number of transactions executed by the current server session.
      server_trans_stat The execution status of the current server session, which indicates whether requests are accurately executed in the current server session.
      hot_sys_var_version The version of general system variables saved by ODP.
      sys_var_version The version of system variables saved by ODP.
      user_var_version The version of user variables saved by ODP.
      last_insert_id_version The version of the last_insert_id variable saved by ODP.
      db_name_version The version of the current database variables saved by ODP.
      is_checksum_supported Indicates whether the checksum is enabled for the current server session.
      is_safe_read_weak_supported Indicates whether security weak-consistency read is supported.
      is_checksum_switch_supported Indicates whether the checksum can be enabled or disabled in real time.
      checksum_switch The enabling status of the checksum.
      enable_extra_ok_packet_for_stats Indicates whether an extra packet is supported for confirming the return status.

    Previous topic

    Query all sessions
    Last

    Next topic

    Query the metrics of a session
    Next
    What is on this page
    Procedure