Note
This view is introduced since OceanBase Database V4.0.0.
Purpose
The GV$OB_PROCESSLIST view displays session information for all OBServer nodes in a tenant.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| SVR_IP | varchar(46) | NO | IP address of the server. |
| SVR_PORT | bigint(20) | NO | Port number of the server. |
| SQL_PORT | bigint(20) | NO | Port number of the SQL service. |
| ID | bigint(20) unsigned | NO | Session ID. |
| USER | varchar(32) | NO | Username. |
| HOST | varchar(128) | NO | Host name of the client. (For example, if you connect to the database through obproxy, this column displays the host name of obproxy.) |
| DB | varchar(128) | YES | Name of the database being accessed. |
| TENANT | varchar(128) | NO | Name of the tenant being accessed. |
| COMMAND | varchar(4096) | NO | Type of the current command. |
| TIME | bigint(20) | NO | Execution time of the current command in seconds. The value is reset to 0 when the command is retried. |
| TOTAL_TIME | bigint(20) | NO | Total execution time of the current command in seconds. The value is not reset when the command is retried. |
| STATE | varchar(128) | YES | Current session status. |
| INFO | varchar(262143) | YES | Displays the command being executed. |
| PROXY_SESSID | bigint(20) unsigned | YES | If the client is obproxy, this column displays the proxy session ID. |
| MASTER_SESSID | bigint(20) unsigned | YES | ID of the master session, which is used to link multiple subsessions of the same SQL statement. |
| USER_CLIENT_IP | varchar(46) | YES | IP address of the user client. |
| USER_HOST | varchar(128) | YES | Host name of the user client. |
| RETRY_CNT | bigint(20) | NO | Number of retries of the current command. |
| RETRY_INFO | bigint(20) | NO | Retry information of the current command, which is generally the error code of the last retry. |
| SQL_ID | varchar(32) | NO | SQL ID. |
| TRANS_ID | bigint(20) unsigned | NO | Transaction ID. |
| THREAD_ID | bigint(20) unsigned | NO | Thread ID. |
| SSL_CIPHER | varchar(4096) | YES | Name of the encryption cipher. |
| TRACE_ID | varchar(64) | YES | Trace ID. |
| TRANS_STATE | varchar(32) | YES | Transaction status. Valid values include:
|
| ACTION | varchar(4096) | YES | Name of the current operation set by calling the DBMS_APPLICATION_INFO.SET_ACTION procedure. |
| MODULE | varchar(4096) | YES | Name of the current operation set by calling the DBMS_APPLICATION_INFO.SET_MODULE procedure. |
| CLIENT_INFO | varchar(4096) | YES | Information set by calling the DBMS_APPLICATION_INFO.SET_CLIENT_INFO procedure. |
| LEVEL | bigint(20) | NO | Indicates the full-link tracing monitoring level of the session. For example, 1 indicates level 1 diagnostic information.
NoteThis field was introduced in V4.2.1. |
| SAMPLE_PERCENTAGE | bigint(20) | NO | Indicates the full-link tracing sampling frequency of the session. For example, 50 indicates that the sampling frequency is 50%.
NoteThis field was introduced in V4.2.1. |
| RECORD_POLICY | varchar(32) | NO | Indicates the full-link tracing recording strategy of the session. Valid values include:
NoteThis field was introduced in V4.2.1. |
| LB_VID | bigint(20) | YES | If you directly connect to the database through load balancing in a public cloud environment, this column displays the VPC ID of the load balancing service. Otherwise, this column displays NULL.
NoteThis field was introduced in V4.2.1. |
| LB_VIP | varchar(46) | YES | If you directly connect to the database through load balancing in a public cloud environment, this column displays the IP address of the client for connecting to the load balancing service. Otherwise, this column displays NULL.
NoteThis field was introduced in V4.2.1. |
| LB_VPORT | bigint(20) | YES | If you directly connect to the database through load balancing in a public cloud environment, this column displays the port for connecting to the load balancing service. Otherwise, this column displays NULL.
NoteThis field was introduced in V4.2.1. |
| IN_BYTES | bigint(20) | NO | Ingress traffic of the session in bytes.
NoteThis field was introduced in V4.2.1. |
| OUT_BYTES | bigint(20) | NO | Egress traffic of the session in bytes.
NoteThis field was introduced in V4.2.1. |
| USER_CLIENT_PORT | bigint(20) | NO | Client address information.
Note
|
| PROXY_USER | varchar(128) | YES |
Note
|
| SERVICE_NAME | varchar(64) | YES | Name of the service that created the session. The value is NULL if the session was not created by a service name.
Note
|
| TOTAL_CPU_TIME | bigint(21) | NO | CPU usage time of the current command in seconds.
Note
|
| TOP_INFO | varchar(262143) | YES | Displays the information of the top-level PL statement where the executing SQL statement is located.
Note
|
| MEMORY_USAGE | bigint(20) | YES | The memory occupied by a single SQL statement, in bytes.
NoteFor V4.3.5, this field was introduced in V4.3.5 BP2. |
Sample queries
Query the session information of all OBServer nodes where the tenant resides.
obclient [oceanbase]> SELECT * FROM oceanbase.GV$OB_PROCESSLIST LIMIT 1\G
The query result is as follows:
*************************** 1. row ***************************
SVR_IP: 172.xx.xxx.xxx
SVR_PORT: 2882
SQL_PORT: 2881
ID: 3221735835
USER: root
HOST: 100.xx.xxx.xxx:28135
DB: demo
TENANT: mysql001
COMMAND: Query
TIME: 120.800875
TOTAL_TIME: 0.000136
STATE: ACTIVE
INFO: INSERT INTO orders (
user_id,
product_name,
order_amount,
order_date,
order_status
) VALUES (
FLOOR(RAND() * 10000),
CONCAT('Product ', FLOOR(RAND() * 1000)),
ROUND(RAND() * 1000, 2),
DATE_SUB(NOW(), INTERVAL FLOOR(RAND() * 1500) DAY),
ELT(FLOOR(RAND() * 3 + 1), 'pending', 'completed', 'cancelled')
)
PROXY_SESSID: NULL
MASTER_SESSID: NULL
USER_CLIENT_IP: 100.xx.xxx.xxx
USER_HOST: %
RETRY_CNT: 0
RETRY_INFO: 0
SQL_ID: A2572E6AF77AEF27E893F08559A9FA67
TRANS_ID: 1463901
THREAD_ID: 2443
SSL_CIPHER: NULL
TRACE_ID: YB4***************************************-0-0
TRANS_STATE: IN_TERMINATE
ACTION:
MODULE:
CLIENT_INFO:
LEVEL: 1
SAMPLE_PERCENTAGE: 50
RECORD_POLICY: ALL
LB_VID: NULL
LB_VIP: NULL
LB_VPORT: NULL
IN_BYTES: 447
OUT_BYTES: 0
USER_CLIENT_PORT: 28135
PROXY_USER:
SERVICE_NAME: NULL
TOTAL_CPU_TIME: 121
TOP_INFO: CALL generate_test_orders()
MEMORY_USAGE: NULL
1 row in set