This topic describes how to view the internal attributes of all network connections in OceanBase Database Proxy (ODP).
Statements
You can execute the SHOW PROXYNET CONNECTION statement to view the internal attributes of network connections in ODP.
SHOW PROXYNET CONNECTION [thread_id [LIMIT xx]]
The parameters are described as follows:
thread_id: the thread ID. Ifthread_idis not specified, the internal attributes of all network connections in ODP are returned. Ifthread_idis specified, the internal attributes of network connections on the specified thread are returned.LIMIT xx: limits the number of rows to return. You can specify this clause in theLIMIT [offset,] rowsandLIMIT rows OFFSET offsetformats, both of which are compatible with MySQL. If rows == -1, all rows are returned.
The output is as follows:
*************************** 1. row ***************************
thread_id: 0
connect_id: 1
socket_fd: 4
type: inner connected
src_ip: XXX.XXX.XXX.XXX
src_port: 43051
dst_ip: XXX.XXX.XXX.XXX
dst_port: 13203
virtual_ip: *Not IP address [0]*
virtual_port: 0
bind_style: any
read_enabled: 1
read_nbytes: 9223372036854775807
read_ndone: 0
write_enabled: 0
write_nbyte: 0
write_ndone: 0
alive_time(sec): 2864
activity_timeout_in(sec): 0
inactivity_timeout_in(sec): 28800
timeout_close_in(sec): 28791
last_error_no: 0
shutdown: 0
comments: not closed
The following table describes the fields.
| Field | Description |
|---|---|
| thread_id | The thread ID. |
| connect_id | The network connection ID. |
| socket_fd | The socket descriptor. |
| type | The connection status. |
| src_ip | The source IP address. |
| src_port | The source port number. |
| dst_ip | The destination IP address. |
| dst_port | The destination port number. |
| virtual_ip | The virtual IP address. |
| virtual_port | The virtual port number. |
| bind_style | The binding type. |
| read_enabled | Indicates whether the connection supports read operations. |
| read_nbytes | The number of bytes to be read. |
| read_ndone | The number of bytes that have been read. |
| write_enabled | Indicates whether the connection supports write operations. |
| write_nbyte | The number of bytes to be sent. |
| write_ndone | The number of bytes that have been sent. |
| alive_time(sec) | The duration when the connection is alive. |
| activity_timeout_in(sec) | The timeout period of the active state. |
| inactivity_timeout_in(sec) | The timeout period of the inactive state. |
| timeout_close_in(sec) | The timeout period after which the connection is closed. |
| last_error_no | The last returned error code. |
| shutdown | The number of closed network connections. |
| comments | The comments. |
Examples
The following examples show how to use the SHOW PROXYNET CONNECTION statement.
View the internal attributes of all network connections in ODP
obclient> SHOW PROXYNET CONNECTION\GThe output is as follows:
*************************** 1. row *************************** thread_id: 0 connect_id: 1 socket_fd: 4 type: inner connected src_ip: XXX.XXX.XXX.XXX src_port: 43051 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 2864 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28791 last_error_no: 0 shutdown: 0 comments: not closed *************************** 2. row *************************** thread_id: 0 connect_id: 3 socket_fd: 24 type: accepted src_ip: XXX.XXX.XXX.XXX src_port: 48292 dst_ip: XXX.XXX.XXX.XXX dst_port: 13205 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1214 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 30 timeout_close_in(sec): 29 last_error_no: 0 shutdown: 0 comments: not closed *************************** 3. row *************************** thread_id: 0 connect_id: 4 socket_fd: 28 type: connected src_ip: XXX.XXX.XXX.XXX src_port: 43154 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1214 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28788 last_error_no: 0 shutdown: 0 comments: not closed *************************** 4. row *************************** thread_id: 1 connect_id: 5 socket_fd: 29 type: inner connected src_ip: XXX.XXX.XXX.XXX src_port: 43156 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1194 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28791 last_error_no: 0 shutdown: 0 comments: not closed *************************** 5. row *************************** thread_id: 3 connect_id: 2 socket_fd: 25 type: inner connected src_ip: XXX.XXX.XXX.XXX src_port: 43052 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 2853 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28799 last_error_no: 0 shutdown: 0 comments: not closed 5 rows in setView the internal attributes of network connections with the thread ID 0 in ODP
obclient> SHOW PROXYNET CONNECTION 0\GThe output is as follows:
*************************** 1. row *************************** thread_id: 0 connect_id: 1 socket_fd: 4 type: inner connected src_ip: XXX.XXX.XXX.XXX src_port: 43051 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 11958 write_ndone: 11958 alive_time(sec): 2919 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 30 timeout_close_in(sec): 30 last_error_no: 0 shutdown: 0 comments: not closed *************************** 2. row *************************** thread_id: 0 connect_id: 3 socket_fd: 24 type: accepted src_ip: XXX.XXX.XXX.XXX src_port: 48292 dst_ip: XXX.XXX.XXX.XXX dst_port: 13205 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1269 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 30 timeout_close_in(sec): 29 last_error_no: 0 shutdown: 0 comments: not closed *************************** 3. row *************************** thread_id: 0 connect_id: 4 socket_fd: 28 type: connected src_ip: XXX.XXX.XXX.XXX src_port: 43154 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1269 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28733 last_error_no: 0 shutdown: 0 comments: not closed 3 rows in setView the internal attributes of network connections with the thread ID 0 in ODP, and return two rows starting from the second row
obclient> SHOW PROXYNET CONNECTION 0 limit 2 offset 1\GThe output is as follows:
*************************** 1. row *************************** thread_id: 0 connect_id: 3 socket_fd: 24 type: accepted src_ip: XXX.XXX.XXX.XXX src_port: 48292 dst_ip: XXX.XXX.XXX.XXX dst_port: 13205 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1269 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 30 timeout_close_in(sec): 29 last_error_no: 0 shutdown: 0 comments: not closed *************************** 2. row *************************** thread_id: 0 connect_id: 4 socket_fd: 28 type: connected src_ip: XXX.XXX.XXX.XXX src_port: 43154 dst_ip: XXX.XXX.XXX.XXX dst_port: 13203 virtual_ip: *Not IP address [0]* virtual_port: 0 bind_style: any read_enabled: 1 read_nbytes: 9223372036854775807 read_ndone: 0 write_enabled: 0 write_nbyte: 0 write_ndone: 0 alive_time(sec): 1269 activity_timeout_in(sec): 0 inactivity_timeout_in(sec): 28800 timeout_close_in(sec): 28733 last_error_no: 0 shutdown: 0 comments: not closed 2 rows in set