This topic describes how to query the internal status of all client sessions for all tenant connections on an OceanBase Database Proxy (ODP).
View the internal status of all sessions
The following sample code provides an example of how to use the SHOW PROXYSESSION statement to query the internal status of all client sessions for all tenant connections on an ODP. Sample code:
obclient> SHOW PROXYSESSION;
+--------------------+------+-----------------+--------+------+-----------------------+------+-------------+-------------------+-------------------+---------+---------+
| proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+--------------------+------+-----------------+--------+------+-----------------------+------+-------------+-------------------+-------------------+---------+---------+
| 756006681247547396 | 2 | ob1.jihua.sjh | sys | root | XXX.XXX.XXX.XXX:22540 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
+--------------------+------+-----------------+--------+------+-----------------------+------+-------------+-------------------+-------------------+---------+---------+
1 row in set
The following table describes the fields in the returned result.
| Field | Description |
|---|---|
| proxy_sessid | The 64-bit ID used by OceanBase Database to identify the ODP. |
| Id | The ID used by the ODP to identify the client, namely, the cs_id value. |
| Cluster | The cluster name. |
| Tenant | The tenant name. |
| User | The username. |
| Host | The IP address and port number of the user. |
| db | The database. |
| trans_count | The number of transactions transmitted by the ODP session. |
| svr_session_count | The number of sessions maintained by the ODP. |
| state | The network connectivity. |
| tid | The thread ID. |
| pid | The process ID. |
Note
Id indicates the ID of a client session in the ODP. It is equivalent to the cs_id parameter. proxy_sessid indicates the 64-bit ID of a client session in OceanBase Database. It is different from the standard parameter CONNECTION_ID(). For more information about CONNECTION_ID, see CONNECTION_ID.