该接口用于查询会话信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
oceanbase:DescribeProcessStatsComposition |
get |
*Instance
|
无 | 无 |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| InstanceId |
string |
是 |
OceanBase 集群 ID。 |
ob******** |
| UId |
string |
否 |
OceanBase 数据库用户标识符。 |
139************* |
| TenantId |
string |
否 |
租户 ID,必填选项。 |
t******** |
| SqlText |
string |
否 |
SQL 语句,支持 LIKE 查询,可以只指定 SQL 语句的部分子句。 |
SELECT **** FROM **** WHERE **** = ? AND **** = ? ORDER BY **** ASC |
| ClientIp |
string |
否 |
客户端 IP。 |
127.*.*.* |
| ServerIp |
string |
否 |
服务器 IP。 |
127.*.*.* |
| Users |
string |
否 |
数据库用户名。 |
["test_user"] |
| Status |
string |
否 |
会话状态。 |
ACTIVE |
| MergeDynamicSql |
boolean |
否 |
返回结果时,是否合并动态 SQL。 说明
|
false |
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
请求的返回结果。 |
||
| RequestId |
string |
请求 ID。 |
EE205C00-30E4-****-****-87E3A8A2AA0C |
| Data |
object |
返回结果。 |
|
| TotalSessionCount |
integer |
总会话数量。 |
100 |
| ActiveSessionCount |
integer |
活跃会话数。 |
60 |
| IdleSessionCount |
integer |
SLEEP 状态会话数量。 |
30 |
| AllProcessList |
array<object> |
所有会话详细信息。 |
|
|
array<object> |
|||
| SqlText |
string |
SQL 文本。 |
select * from c1 where id = 100; |
| TenantId |
string |
租户 ID。 |
t******** |
| Database |
string |
数据库名称。 |
c1 |
| User |
string |
该会话所属的用户。 |
test_user |
| ExecuteTime |
integer |
根据是否执行命令:
单位为秒。 |
5 |
| CpuTime |
integer |
当前命令执行 CPU 使用时间,单位:s。 说明
该字段从 V3.2.4 BP5 版本开始引入 |
1 |
| ServerIp |
string |
服务器 IP 地址。 |
xx.xx.xx.xx |
| ClientIp |
string |
客户端 IP。 |
xx.xx.xx.xx |
| SessionId |
integer |
会话 ID。 |
322441**** |
| ProxySessId |
string |
如果当前客户端是 ODP,则本列展示 ODP 的 Session ID。 |
7521015416******** |
| Command |
string |
该会话正在执行的命令。 |
Query |
| Status |
string |
该会话当前的状态。 |
ACTIVE |
| SqlId |
string |
SQL ID。 |
45CCBDC7DEBDCDAXXXXAFC******** |
| TraceId |
string |
Trace ID。 |
YB420XXX128-00062XXXX8313XXX1-X-X |
| PlanId |
integer |
执行计划 ID。 |
1898 |
| DynamicSql |
boolean |
是否为动态 SQL。 |
false |
| ProcessSqlLists |
array<object> |
子 SQL 列表 |
|
|
array<object> |
|||
| SqlText |
string |
SQL 文本。 |
select * from c1 where id = 100; |
| TenantId |
string |
租户 ID。 |
t******** |
| Database |
string |
数据库名称。 |
c2 |
| User |
string |
该会话所属的用户。 |
test_user |
| ExecuteTime |
integer |
根据是否执行命令:
单位为秒。 |
5 |
| CpuTime |
integer |
当前命令执行 CPU 使用时间,单位:s。 说明
该字段从 V3.2.4 BP5 版本开始引入 |
1 |
| ServerIp |
string |
服务器 IP 地址。 |
xx.xx.xx.xx |
| ClientIp |
string |
客户端 IP。 |
xx.xx.xx.xx |
| SessionId |
integer |
会话 ID。 |
322441**** |
| ProxySessId |
string |
如果当前客户端是 ODP,则本列展示 ODP 的 Session ID。 |
7521015416******** |
| Command |
string |
该会话正在执行的命令。 |
Query |
| Status |
string |
该会话当前的状态。 |
ACTIVE |
| SqlId |
string |
SQL ID。 |
45CCBDC7DEBDCDAXXXXAFC******** |
| TraceId |
string |
Trace ID。 |
YB420XXX128-00062XXXX8313XXX1-X-X |
| PlanId |
integer |
执行计划 ID。 |
1898 |
| DynamicSql |
boolean |
是否为动态 SQL。 |
false |
| ProcessSqlList |
array<object> |
子 SQL 列表 |
|
|
object |
|||
| SqlText |
string |
SQL 文本。 |
select * from c1 where id = 100; |
| TenantId |
string |
租户 ID。 |
t******** |
| Database |
string |
数据库名称。 |
c3 |
| User |
string |
该会话所属的用户。 |
test_user |
| ExecuteTime |
integer |
根据是否执行命令:
单位为秒。 |
5 |
| CpuTime |
integer |
当前命令执行 CPU 使用时间,单位:s。 说明
该字段从 V3.2.4 BP5 版本开始引入 |
1 |
| ServerIp |
string |
服务器 IP 地址。 |
xx.xx.xx.xx |
| ClientIp |
string |
客户端 IP。 |
xx.xx.xx.xx |
| SessionId |
integer |
会话 ID。 |
322441**** |
| ProxySessId |
string |
如果当前客户端是 ODP,则本列展示 ODP 的 Session ID。 |
7521015416******** |
| Command |
string |
该会话正在执行的命令。 |
Query |
| Status |
string |
该会话当前的状态。 |
ACTIVE |
| SqlId |
string |
SQL ID。 |
45CCBDC7DEBDCDAXXXXAFC******** |
| TraceId |
string |
Trace ID。 |
YB420XXX128-00062XXXX8313XXX1-X-X |
| PlanId |
integer |
执行计划 ID。 |
1898 |
| DynamicSql |
boolean |
是否为动态 SQL。 |
false |
| ServerSn |
string |
节点 ID。 |
i-bp1*****sw64dhb***** |
| SessionStatistics |
object |
按照不同来源的会话统计。 |
|
| UserStatistics |
array<object> |
按照用户维度的会话统计。 |
|
|
object |
|||
| MetricValue |
string |
用户名。 |
test_user |
| ActiveCount |
integer |
活跃会话数量。 |
25 |
| TotalCount |
integer |
总数量。 |
30 |
| Type |
string |
user。 |
user |
| SourceStatistics |
array<object> |
按照 Client 维度的会话统计。 |
|
|
object |
|||
| MetricValue |
string |
用户客户端 IP。 |
xx.xx.xx.xx |
| ActiveCount |
integer |
活跃会话数量。 |
25 |
| TotalCount |
integer |
总数量。 |
30 |
| Type |
string |
client。 |
client |
| DataBaseStatistics |
array<object> |
按照数据库维度的会话统计。 |
|
|
object |
|||
| MetricValue |
string |
数据库名。 |
test_database |
| ActiveCount |
integer |
活跃会话数量。 |
25 |
| TotalCount |
integer |
总数量。 |
30 |
| Type |
string |
database。 |
database |
| ObVersion |
string |
Ob 版本号 |
3.2.4 |
示例
正常返回示例
JSON格式
{
"RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
"Data": {
"TotalSessionCount": 100,
"ActiveSessionCount": 60,
"IdleSessionCount": 30,
"AllProcessList": [
{
"SqlText": "select * from c1 where id = 100;",
"TenantId": "t********",
"Database": "c1",
"User": "test_user",
"ExecuteTime": 5,
"CpuTime": 1,
"ServerIp": "xx.xx.xx.xx",
"ClientIp": "xx.xx.xx.xx",
"SessionId": 0,
"ProxySessId": "7521015416********",
"Command": "Query",
"Status": "ACTIVE",
"SqlId": "45CCBDC7DEBDCDAXXXXAFC********",
"TraceId": "YB420XXX128-00062XXXX8313XXX1-X-X",
"PlanId": 1898,
"DynamicSql": false,
"ProcessSqlLists": [
{
"SqlText": "select * from c1 where id = 100;",
"TenantId": "t********",
"Database": "c2",
"User": "test_user",
"ExecuteTime": 5,
"CpuTime": 1,
"ServerIp": "xx.xx.xx.xx",
"ClientIp": "xx.xx.xx.xx",
"SessionId": 0,
"ProxySessId": "7521015416********",
"Command": "Query",
"Status": "ACTIVE",
"SqlId": "45CCBDC7DEBDCDAXXXXAFC********",
"TraceId": "YB420XXX128-00062XXXX8313XXX1-X-X",
"PlanId": 1898,
"DynamicSql": false,
"ProcessSqlList": [
{
"SqlText": "select * from c1 where id = 100;",
"TenantId": "t********",
"Database": "c3",
"User": "test_user",
"ExecuteTime": 5,
"CpuTime": 1,
"ServerIp": "xx.xx.xx.xx",
"ClientIp": "xx.xx.xx.xx",
"SessionId": 0,
"ProxySessId": "7521015416********",
"Command": "Query",
"Status": "ACTIVE",
"SqlId": "45CCBDC7DEBDCDAXXXXAFC********\n",
"TraceId": "YB420XXX128-00062XXXX8313XXX1-X-X",
"PlanId": 1898,
"DynamicSql": false
}
]
}
],
"ServerSn": "i-bp1*****sw64dhb*****"
}
],
"SessionStatistics": {
"UserStatistics": [
{
"MetricValue": "test_user",
"ActiveCount": 25,
"TotalCount": 30,
"Type": "user"
}
],
"SourceStatistics": [
{
"MetricValue": "xx.xx.xx.xx",
"ActiveCount": 25,
"TotalCount": 30,
"Type": "client"
}
],
"DataBaseStatistics": [
{
"MetricValue": "test_database",
"ActiveCount": 25,
"TotalCount": 30,
"Type": "database"
}
]
},
"ObVersion": "3.2.4"
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。