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 Proxy

V4.2.0Community Edition

  • What is ODP?
  • Installation and deployment
    • Deploy ODP by using OBD
    • Deploy ODP by using OCP
    • Deploy ODP by using the CLI
    • Deployment modes
  • Basic operations
  • Configuration parameter
    • Parameter description
    • Dynamically modifiable parameters
    • Parameters that are not dynamically modifiable
    • Internal and inherited parameters
    • In-memory parameters
  • Connection management
    • Principles
    • Session status synchronization
    • Client session
    • Server session
  • Data routing
    • Factors affecting data routing
    • Routing strategies
    • ODP routing
    • Intra-tenant routing
    • Read/Write separation
    • Follower latency threshold
  • High availability mechanism
    • Overview
    • High availability of ODP services
    • High availability of OceanBase Database
    • High availability testing
  • Security and protocols
  • Operation and maintenance
    • Troubleshooting
      • Troubleshooting logic
      • Monitoring logs
    • Performance analysis
    • Show Trace

Download PDF

What is ODP? Deploy ODP by using OBD Deploy ODP by using OCP Deploy ODP by using the CLI Deployment modes Basic operations Parameter description Dynamically modifiable parameters Parameters that are not dynamically modifiable Internal and inherited parameters In-memory parameters Principles Session status synchronization Client session Server session Factors affecting data routing Routing strategies ODP routing Intra-tenant routing Read/Write separation Follower latency threshold Overview High availability of ODP services High availability of OceanBase Database High availability testing Security and protocols Troubleshooting logic Monitoring logs Performance analysis Show Trace
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
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 Proxy
  3. V4.2.0
iconOceanBase Database Proxy
V 4.2.0Community Edition
  • V 4.3.6
  • V 4.3.4
  • V 4.3.3
  • V 4.3.2
  • V 4.3.1
  • V 4.3.0
  • V 4.2.3
  • V 4.2.2
  • V 4.2.0 and earlier
Community Edition
  • V 4.2.0
  • V 4.1.0
  • V 4.0.0
  • V 3.1.0

Server session

Last Updated:2023-10-10 02:43:33  Updated
share
What is on this page
View a server session
Terminate a server session

folded

share

This topic describes several general operations performed on a server session, which is established between OceanBase Database Proxy (ODP) and an OBServer node.

View a server session

At present, it is not supported to view a server session through ODP. You can log in to the sys tenant of the OceanBase cluster as the root user and view all OBServer nodes in the cluster. Then, you can directly connect to the target OBServer node and view the server session.

  1. Log in to the sys tenant of the OceanBase cluster as the root user and view all OBServer nodes in the cluster.

    obclient> select * from oceanbase.__all_server;
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    | gmt_create                 | gmt_modified               | svr_ip     | svr_port | id | zone | inner_port | with_rootserver | status | block_migrate_in_time | build_version                                                            | stop_time | start_service_time | first_sessid | with_partition |
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    | 2023-02-28 15:45:53.230044 | 2023-02-28 15:46:25.577180 | 10.10.10.1 |     2882 |  3 | z3   |       2881 |               1 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570376568330 |            0 |              1 |
    | 2023-02-28 15:45:53.197477 | 2023-02-28 15:46:25.534448 | 10.10.10.2 |     2882 |  2 | z2   |       2881 |               0 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570376522994 |            0 |              1 |
    | 2023-02-28 15:45:53.113870 | 2023-02-28 15:46:25.098607 | 10.10.10.3 |     2882 |  1 | z1   |       2881 |               0 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570378084150 |            0 |              1 |
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    3 rows in set
    
  2. Select the target OBServer node and directly connect to it. The following sample code directly connects to the OBServer node with the IP address 10.10.10.1 and the SQL port 2881.

    [admin@test001 ~]$ obclient -h10.10.10.1 -P2881 -uroot@sys -p -Doceanbase -A
    
  3. Run the show processlist; command to view all sessions of the current OBServer node.

    obclient> show processlist;
    

    Returned result:

    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    | Id         | User    | Host             | db        | Command | Time | State  | Info             |
    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    | 3221812197 | root    | 10.10.10.1:48563 | NULL      | Query   |    0 | ACTIVE | show processlist |
    | 3222117829 | proxyro | 10.10.10.1:37876 | oceanbase | Sleep   |    6 | SLEEP  | NULL             |
    | 3221709618 | root    | 10.10.10.1:51390 | NULL      | Sleep   |  831 | SLEEP  | NULL             |
    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    3 rows in set
    

Terminate a server session

At present, ODP does not provide a command to directly terminate a server session. You can terminate a server session by directly connecting to the target OBServer node.

  1. Log in to the sys tenant of the OceanBase cluster as the root user and view all OBServer nodes in the cluster.

    obclient> select * from oceanbase.__all_server;
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    | gmt_create                 | gmt_modified               | svr_ip     | svr_port | id | zone | inner_port | with_rootserver | status | block_migrate_in_time | build_version                                                            | stop_time | start_service_time | first_sessid | with_partition |
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    | 2023-02-28 15:45:53.230044 | 2023-02-28 15:46:25.577180 | 10.10.10.1 |     2882 |  3 | z3   |       2881 |               1 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570376568330 |            0 |              1 |
    | 2023-02-28 15:45:53.197477 | 2023-02-28 15:46:25.534448 | 10.10.10.2 |     2882 |  2 | z2   |       2881 |               0 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570376522994 |            0 |              1 |
    | 2023-02-28 15:45:53.113870 | 2023-02-28 15:46:25.098607 | 10.10.10.3 |     2882 |  1 | z1   |       2881 |               0 | ACTIVE |                     0 | 4.1.0.0_1-703037f0b023c8ffa880258463b25b1735cf27b3(Feb 28 2023 13:21:21) |         0 |   1677570378084150 |            0 |              1 |
    +----------------------------+----------------------------+------------+----------+----+------+------------+-----------------+--------+-----------------------+--------------------------------------------------------------------------+-----------+--------------------+--------------+----------------+
    3 rows in set
    
  2. Directly connect to the target OBServer node. The following sample code directly connects to the OBServer node with the IP address 10.10.10.1 and SQL port 2881.

    [admin@test001 ~]$ obclient -h10.10.10.1 -P2881 -uroot@sys -p -Doceanbase -A
    
  3. Run the show processlist; command to view all sessions of the current OBServer node.

    obclient> show processlist;
    

    Returned result:

    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    | Id         | User    | Host             | db        | Command | Time | State  | Info             |
    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    | 3221812197 | root    | 10.10.10.1:48563 | NULL      | Query   |    0 | ACTIVE | show processlist |
    | 3222117829 | proxyro | 10.10.10.1:37876 | oceanbase | Sleep   |    6 | SLEEP  | NULL             |
    | 3221709618 | root    | 10.10.10.1:51390 | NULL      | Sleep   |  831 | SLEEP  | NULL             |
    +------------+---------+------------------+-----------+---------+------+--------+------------------+
    3 rows in set
    
  4. Run the kill <id> command to terminate the current session whose Id is 3221812197.

    obclient> kill 3221812197;
    ERROR 2013 (HY000): Lost connection to MySQL server during query
    

Previous topic

Client session
Last

Next topic

Factors affecting data routing
Next
What is on this page
View a server session
Terminate a server session