All Products
Search
Document Center

ApsaraDB for OceanBase:DescribeProcessStatsComposition

Last Updated:Dec 02, 2024

You can call this operation to query session information.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
oceanbase:DescribeProcessStatsCompositionget
*Instance
acs:oceanbase:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the OceanBase cluster.

ob317v4uif****
UIdstringNo

The user identifier (UID) of OceanBase Database.

139*************
TenantIdstringNo

The ID of the tenant.

t33h8y08k****
SqlTextstringNo

The SQL statement. It supports LIKE clauses, and you may specify only part of the clauses in the SQL statement.

SELECT **** FROM **** WHERE **** = ? AND **** = ? ORDER BY **** ASC
ClientIpstringNo

The IP address of the client.

127.*.*.*
ServerIpstringNo

The IP address of the server.

127.*.*.*
UsersstringNo

The username that you use to log in to the database.

test1
StatusstringNo

The state of the session.

ACTIVE

Response parameters

ParameterTypeDescriptionExample
object

The return result of the request.

RequestIdstring

The ID of the request.

EE205C00-30E4-****-****-87E3A8A2AA0C
Dataarray<object>

The return result.

Dataobject

The return result.

TotalSessionCountinteger

The total number of sessions.

500
ActiveSessionCountinteger

The number of active sessions.

25
IdleSessionCountinteger

The number of idle sessions.

8
AllProcessListarray<object>

The list of all processes in the system.

AllProcessListobject

The return result of the request.

SqlTextstring

The SQL statement.

SELECT * FROM table_name;
TenantIdstring

The ID of the tenant.

t33h8y08k****
Databasestring

The name of the database.

database1
Userstring

The username that you use to log in to the database.

test1
ExecuteTimelong

The execution time.

18.23
CpuTimelong

The CPU time.

257.943
ServerIpstring

The IP address of the server.

127.*.*.*
ClientIpstring

The IP address of the client.

127.*.*.*
SessionIdlong

The ID of the session.

1***************90L
ProxySessIdstring

The ID of the proxy session.

ab***-********-90ab-c***-***********b
Commandstring

The type of command executed on the current session.

Sleep
Statusstring

The state of the session.

ACTIVE
SqlIdstring

The ID of the SQL statement.

8D6E84****0B8FB1823D199E2CA1****
TraceIdstring

The ID of the trace.

3c6e****-cb**-11**-a5**-4201ac1****f
PlanIdstring

The ID of the plan.

af621fe01e064743bd37e7c9a41aa139
SessionStatisticsobject

The session statistics.

UserStatisticsarray<object>

The user statistics.

UserStatisticsobject

The return result of the request.

MetricValuestring

The value of the user metric.

admin
ActiveCountlong

The number of active sessions.

5
TotalCountlong

The total number of sessions.

15
Typestring

The type of the user.

user
SourceStatisticsarray<object>

The data source statistics.

SourceStatisticsobject

The return result of the request.

MetricValuestring

The value of the data source metric.

127.*.*.*
ActiveCountlong

The number of active sessions.

2
TotalCountlong

The total number of sessions.

12
Typestring

The type of the data source.

client
DataBaseStatisticsarray<object>

The database statistics.

DataBaseStatisticsobject

The return result of the request.

MetricValuestring

The value of the database metric.

test_database
ActiveCountlong

The number of active sessions.

1
TotalCountlong

The total number of sessions.

9
Typestring

The type of the database statistics.

database
ObVersionstring

The version of OceanBase Database.

4.2.1.0

Examples

Sample success responses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "TotalSessionCount": 500,
      "ActiveSessionCount": 25,
      "IdleSessionCount": 8,
      "AllProcessList": [
        {
          "SqlText": "SELECT * FROM table_name;",
          "TenantId": "t33h8y08k****",
          "Database": "database1",
          "User": "test1",
          "ExecuteTime": 18.23,
          "CpuTime": 257.943,
          "ServerIp": "127.*.*.*",
          "ClientIp": "127.*.*.*",
          "SessionId": 0,
          "ProxySessId": "ab***-********-90ab-c***-***********b",
          "Command": "Sleep",
          "Status": "ACTIVE",
          "SqlId": "8D6E84****0B8FB1823D199E2CA1****",
          "TraceId": "\n3c6e****-cb**-11**-a5**-4201ac1****f",
          "PlanId": "af621fe01e064743bd37e7c9a41aa139"
        }
      ],
      "SessionStatistics": {
        "UserStatistics": [
          {
            "MetricValue": "admin",
            "ActiveCount": 5,
            "TotalCount": 15,
            "Type": "user"
          }
        ],
        "SourceStatistics": [
          {
            "MetricValue": "127.*.*.*",
            "ActiveCount": 2,
            "TotalCount": 12,
            "Type": "client"
          }
        ],
        "DataBaseStatistics": [
          {
            "MetricValue": "test_database",
            "ActiveCount": 1,
            "TotalCount": 9,
            "Type": "database"
          }
        ]
      },
      "ObVersion": "4.2.1.0"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-05-27The response structure of the API has changedView Change Details