描述
使用show proxysession attribute [id [like 'xxx']]
语句:
- 展示指定cs的内部状态,包括该cs上涉及的相关server session。
- kill server session时,可以从此处获取server session id。
id
既可以是cs id,也可以是connection id, 展示结果相同。- cs id为proxy内部标记每个client的id号, connection id为整个OceanBase数据库标记每个client的id号。
- 不指定
id
时, 显示当前session详细状态(proxy 1.1.0版本起开始支持), 支持模糊查询当前session指定属性名称的value(proxy 1.1.2版本起开始支持)。 - 指定
id
后, 支持模糊查询指定属性名称的value(proxy 1.1.0版本起开始支持)。
示例
mysql> 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 | 127.0.0.1:22540 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
+--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
1 row in set (0.00 sec)
mysql> show proxysession attribute;
+------------------------+---------------------+----------------+
| attribute_name | value | info |
+------------------------+---------------------+----------------+
| proxy_sessid | 756006681247547396 | cs common |
| cs_id | 2 | cs common |
| cluster | ob1.jianhua.sjh | cs common |
| tenant | sys | cs common |
| user | root | cs common |
| host_ip | 127.0.0.1 | cs common |
| host_port | 22540 | 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 | 2230520 | cs common |
| pid | 2230520 | cs common |
| modified_time | 1469435190244371115 | cs stat |
| reported_time | 1469435190244371115 | cs stat |
| hot_sys_var_version | 0 | cs var version |
| sys_var_version | 0 | 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 | 10.244.4.28 | last used ss |
| server_port | 13203 | last used ss |
| server_sessid | 2147549201 | last used ss |
| ss_id | 4 | last used ss |
| state | MSS_KA_CLIENT_SLAVE | last used ss |
| transact_count | 2 | last used ss |
| server_trans_stat | 0 | last used ss |
| hot_sys_var_version | 0 | last used ss |
| sys_var_version | 0 | 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 |
+------------------------+---------------------+----------------+
33 rows in set (0.00 sec)
mysql> show proxysession attribute 2 like '%id%';
+------------------------+--------------------+----------------+
| attribute_name | value | info |
+------------------------+--------------------+----------------+
| proxy_sessid | 756006681247547396 | cs common |
| cs_id | 2 | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| last_insert_id_version | 0 | cs var version |
| server_sessid | 2147549201 | last used ss |
| ss_id | 4 | last used ss |
| last_insert_id_version | 0 | last used ss |
+------------------------+--------------------+----------------+
8 rows in set (0.00 sec)
mysql> show proxysession attribute 2147549201 like '%id%';
+------------------------+--------------------+----------------+
| attribute_name | value | info |
+------------------------+--------------------+----------------+
| proxy_sessid | 756006681247547396 | cs common |
| cs_id | 2 | cs common |
| tid | 2230520 | cs common |
| pid | 2230520 | cs common |
| last_insert_id_version | 0 | cs var version |
| server_sessid | 2147549201 | last used ss |
| ss_id | 4 | last used ss |
| last_insert_id_version | 0 | last used ss |
+------------------------+--------------------+----------------+
8 rows in set (0.00 sec)
OceanBase (root@oceanbase)> show proxyinfo binary\G
*************************** 1. row ***************************
name: binary info
info: ObProxy-OceanBase 1.1.2-456.el6
version:RELEASE_6U
MD5:
REVISION:456-local-5ba2e3d33ea201fb675eb704627162a584485cdd
BUILD_TIME:Sep 29 2016 09:40:18
BUILD_FLAGS:-g -O2 -D_OB_VERSION=1000 -D_NO_EXCEPTION -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wall -Werror -Wextra -Wunused-parameter -Wformat -Wconversion -Wno-deprecated -Wno-invalid-offsetof -finline-functions -fno-strict-aliasing -mtune=core2 -Wno-psabi -Wno-sign-compare -DGCC_52 -DUSE_POSIX_FALLOCATE -DSUPPORT_SSE4_2 -DHAVE_SCHED_GETCPU -DHAVE_REALTIME_COARSE -DOB_HAVE_EVENTFD -DHAVE_FALLOCATE -DHAVE_MINIDUMP
1 row in set (0.00 sec)
OceanBase (root@oceanbase)> show proxysession attribute like "%id";
+----------------+--------------------+--------------+
| attribute_name | value | info |
+----------------+--------------------+--------------+
| proxy_sessid | 756006681247416327 | cs common |
| cs_id | 6 | cs common |
| tid | 97247 | cs common |
| pid | 97247 | cs common |
| server_sessid | 2147549196 | last used ss |
| ss_id | 7 | last used ss |
+----------------+--------------------+--------------+
6 rows in set (0.00 sec)