描述

    使用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版本起开始支持)。

    示例

    1. mysql> show proxysession;
    2. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    3. | proxy_sessid | Id | Cluster | Tenant | User | Host | db | trans_count | svr_session_count | state | tid | pid |
    4. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    5. | 756006681247547396 | 2 | ob1.jianhua.sjh | sys | root | 127.0.0.1:22540 | NULL | 0 | 1 | MCS_ACTIVE_READER | 2230520 | 2230520 |
    6. +--------------------+------+-----------------+--------+------+-----------------+------+-------------+-------------------+-------------------+---------+---------+
    7. 1 row in set (0.00 sec)
    8. mysql> show proxysession attribute;
    9. +------------------------+---------------------+----------------+
    10. | attribute_name | value | info |
    11. +------------------------+---------------------+----------------+
    12. | proxy_sessid | 756006681247547396 | cs common |
    13. | cs_id | 2 | cs common |
    14. | cluster | ob1.jianhua.sjh | cs common |
    15. | tenant | sys | cs common |
    16. | user | root | cs common |
    17. | host_ip | 127.0.0.1 | cs common |
    18. | host_port | 22540 | cs common |
    19. | db | NULL | cs common |
    20. | total_trans_cnt | 0 | cs common |
    21. | svr_session_cnt | 1 | cs common |
    22. | active | true | cs common |
    23. | read_state | MCS_ACTIVE_READER | cs common |
    24. | tid | 2230520 | cs common |
    25. | pid | 2230520 | cs common |
    26. | modified_time | 1469435190244371115 | cs stat |
    27. | reported_time | 1469435190244371115 | cs stat |
    28. | hot_sys_var_version | 0 | cs var version |
    29. | sys_var_version | 0 | cs var version |
    30. | user_var_version | 0 | cs var version |
    31. | last_insert_id_version | 0 | cs var version |
    32. | db_name_version | 0 | cs var version |
    33. | server_ip | 10.244.4.28 | last used ss |
    34. | server_port | 13203 | last used ss |
    35. | server_sessid | 2147549201 | last used ss |
    36. | ss_id | 4 | last used ss |
    37. | state | MSS_KA_CLIENT_SLAVE | last used ss |
    38. | transact_count | 2 | last used ss |
    39. | server_trans_stat | 0 | last used ss |
    40. | hot_sys_var_version | 0 | last used ss |
    41. | sys_var_version | 0 | last used ss |
    42. | user_var_version | 0 | last used ss |
    43. | last_insert_id_version | 0 | last used ss |
    44. | db_name_version | 0 | last used ss |
    45. +------------------------+---------------------+----------------+
    46. 33 rows in set (0.00 sec)
    47. mysql> show proxysession attribute 2 like '%id%';
    48. +------------------------+--------------------+----------------+
    49. | attribute_name | value | info |
    50. +------------------------+--------------------+----------------+
    51. | proxy_sessid | 756006681247547396 | cs common |
    52. | cs_id | 2 | cs common |
    53. | tid | 2230520 | cs common |
    54. | pid | 2230520 | cs common |
    55. | last_insert_id_version | 0 | cs var version |
    56. | server_sessid | 2147549201 | last used ss |
    57. | ss_id | 4 | last used ss |
    58. | last_insert_id_version | 0 | last used ss |
    59. +------------------------+--------------------+----------------+
    60. 8 rows in set (0.00 sec)
    61. mysql> show proxysession attribute 2147549201 like '%id%';
    62. +------------------------+--------------------+----------------+
    63. | attribute_name | value | info |
    64. +------------------------+--------------------+----------------+
    65. | proxy_sessid | 756006681247547396 | cs common |
    66. | cs_id | 2 | cs common |
    67. | tid | 2230520 | cs common |
    68. | pid | 2230520 | cs common |
    69. | last_insert_id_version | 0 | cs var version |
    70. | server_sessid | 2147549201 | last used ss |
    71. | ss_id | 4 | last used ss |
    72. | last_insert_id_version | 0 | last used ss |
    73. +------------------------+--------------------+----------------+
    74. 8 rows in set (0.00 sec)
    1. OceanBase (root@oceanbase)> show proxyinfo binary\G
    2. *************************** 1. row ***************************
    3. name: binary info
    4. info: ObProxy-OceanBase 1.1.2-456.el6
    5. version:RELEASE_6U
    6. MD5:
    7. REVISION:456-local-5ba2e3d33ea201fb675eb704627162a584485cdd
    8. BUILD_TIME:Sep 29 2016 09:40:18
    9. 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
    10. 1 row in set (0.00 sec)
    11. OceanBase (root@oceanbase)> show proxysession attribute like "%id";
    12. +----------------+--------------------+--------------+
    13. | attribute_name | value | info |
    14. +----------------+--------------------+--------------+
    15. | proxy_sessid | 756006681247416327 | cs common |
    16. | cs_id | 6 | cs common |
    17. | tid | 97247 | cs common |
    18. | pid | 97247 | cs common |
    19. | server_sessid | 2147549196 | last used ss |
    20. | ss_id | 7 | last used ss |
    21. +----------------+--------------------+--------------+
    22. 6 rows in set (0.00 sec)