This topic describes how to query the internal status of all client sessions for all tenant connections on ODP.
Procedure
You can query the internal status of all client sessions for all tenant connections on ODP by using the SHOW PROXYSESSION statement in the sys tenant, and query the internal status of all client sessions for connections of the current tenant on ODP by using the SHOW PROXYSESSION statement in a user tenant.
Connect to OceanBase AI Database by using ODP.
Here is an example:
obclient -h10.xx.xx.xx -uusername@obtenant#obdemo -P2883 -p****** -c -A oceanbaseFor more information about how to connect to OceanBase AI Database by using ODP, see Connect to OceanBase AI Database by using OBClient.
Query the internal status of all client sessions for all tenant connections on ODP.
Query all client sessions for all tenant connections from the sys tenant
SHOW PROXYSESSION;The query result is as follows:
+----------------------+--------+---------+-----------+------+----------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid | using_ssl | +----------------------+--------+---------+-----------+------+----------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ | 12402499708487139332 | 65537 | test420 | sys | root | 100.xx.xx.xx:62630 | NULL | 0 | 1 | MCS_ACTIVE_READER | 96540 | 96535 | 0 | | 12402499708487139333 | 131073 | test420 | oracle001 | sys | 100.xx.xx.xx:4722 | SYS | 0 | 1 | MCS_ACTIVE_READER | 96541 | 96535 | 0 | | 12402499708487139331 | 1 | test420 | sys | root | 100.xx.xx.xx:25510 | NULL | 0 | 1 | MCS_ACTIVE_READER | 96535 | 96535 | 0 | +----------------------+--------+---------+-----------+------+----------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ 3 rows in setQuery all client sessions for connections of a user tenant from the current tenant
SHOW PROXYSESSION;The query result is as follows:
+----------------------+--------+---------+-----------+------+---------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid | using_ssl | +----------------------+--------+---------+-----------+------+---------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ | 12402499708487139333 | 131073 | test420 | oracle001 | sys | 100.xx.xx.xx:4722 | SYS | 0 | 1 | MCS_ACTIVE_READER | 96541 | 96535 | 0 | +----------------------+--------+---------+-----------+------+---------------------+------+-------------+-------------------+-------------------+-------+-------+-----------+ 1 row in set
The following table describes the fields in the returned result.
FieldDescriptionproxy_sessid The 64-bit ID used by OceanBase AI Database to identify ODP. Id The ID used by ODP to identify the client, namely, the cs id.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 in the ODP session. svr_session_count The number of sessions maintained by ODP. state The network connection status. tid The thread ID. pid The process ID. using_ssl Indicates whether the Secure Sockets Layer (SSL) protocol is enabled. 0indicates that SSL is disabled, and1indicates that SSL is enabled.Note
Idindicates the ID of a client session in ODP. It is equivalent to thecs id.proxy_sessidindicates the 64-bit ID of a client session in OceanBase AI Database. It is different from the standardCONNECTION_ID(). For more information aboutCONNECTION_ID, see CONNECTION_ID.