This topic describes how to query the internal status of all client sessions for all tenant connections on OceanBase Database Proxy (ODP).
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:
Here is an example:
obclient> SHOW PROXYSESSION;
+--------------------+------+-----------------+--------+------+-----------------------+------+-------------+-------------------+-------------------+---------+---------+
| proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
+--------------------+------+-----------------+--------+------+-----------------------+------+-------------+-------------------+-------------------+---------+---------+
| 756006681247547396 | 2 | ob1.jianhua.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 parameters in the returned results.
| Parameter | Description |
|---|---|
| proxy_sessid | The 64-bit ID used by OceanBase Database to identify the ODP. |
| Id | The ID used by 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 name. |
| trans_count | The number of transmitted transactions of the ODP. |
| svr_session_count | The number of sessions maintained by the ODP. |
| state | The network connectivity. |
| tid | The thread ID. |
| pid | The process ID. |
Note
Idindicates the ID of a client session in the ODP. It is equivalent to thecs_idparameter.proxy_sessidindicates the 64-bit ID of a client session in OceanBase Database. It is different from the standard parameterCONNECTION_ID(). For more information aboutCONNECTION_ID, see CONNECTION_ID.