All Products
Search
Document Center

ApsaraDB for OceanBase (Deprecated):DescribeProcessStatsComposition

Last Updated:Jun 12, 2026

Mengkueri informasi sesi.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

oceanbase:DescribeProcessStatsComposition

get

*Instance

acs:oceanbase:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID kluster OceanBase.

ob********

UId

string

No

Pengidentifikasi pengguna database OceanBase.

139*************

TenantId

string

No

ID penyewa. Parameter ini wajib diisi.

t********

SqlText

string

No

Pernyataan SQL. Kueri LIKE didukung. Anda hanya dapat menentukan sebagian klausa dari pernyataan SQL.

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

ClientIp

string

No

IP klien.

127.*.*.*

ServerIp

string

No

IP server.

127.*.*.*

Users

string

No

Nama pengguna database.

["test_user"]

Status

string

No

Status sesi.

ACTIVE

MergeDynamicSql

boolean

No

Apakah akan menggabungkan SQL dinamis saat mengembalikan hasil.

Catatan


Apakah akan menggabungkan hasil pernyataan SQL dengan kueri IN pada keluaran.

false

Elemen respons

Element

Type

Description

Example

object

Hasil respons permintaan.

RequestId

string

ID permintaan.

EE205C00-30E4-****-****-87E3A8A2AA0C

Data

object

Data respons.

TotalSessionCount

integer

Jumlah total sesi.

100

ActiveSessionCount

integer

Jumlah sesi aktif.

60

IdleSessionCount

integer

Jumlah sesi dalam status SLEEP.

30

AllProcessList

array<object>

Informasi detail tentang semua sesi.

array<object>

SqlText

string

The SQL text.

select * from c1 where id = 100;

TenantId

string

The ID of the tenant.

t********

Database

string

The name of the database.

c1

User

string

The user to which the session belongs.

test_user

ExecuteTime

integer

The definition of this parameter varies based on whether the SQL statement is executed.

  • When the request is accepted and the result is not returned to the client, this parameter indicates the time interval between the time when the request is accepted and the current time, in seconds.

  • When the request is not accepted, this parameter indicates the duration for which the current status lasts, in seconds.

5

CpuTime

integer

The CPU time spent on executing the current SQL statement, in seconds.

Catatan

This parameter is introduced since OceanBase Database V3.2.4 BP5.

1

ServerIp

string

The IP address of the server.

xx.xx.xx.xx

ClientIp

string

The IP address of the client.

xx.xx.xx.xx

SessionId

integer

The ID of the session.

322441****

ProxySessId

string

The session ID of the client. If an OceanBase Database Proxy (ODP) is used for connection, the session ID of the ODP is returned.

7521015416********

Command

string

The type of the SQL statement being executed in the session.

Query

Status

string

The status of the session.

ACTIVE

SqlId

string

The ID of the SQL statement.

45CCBDC7DEBDCDAXXXXAFC********

TraceId

string

The ID of the trace.

YB420XXX128-00062XXXX8313XXX1-X-X

PlanId

string

The ID of the execution plan.

1898

DynamicSql

string

false

ProcessSqlLists

array<object>

array<object>

SqlText

string

select * from c1 where id = 100;

TenantId

string

t********

Database

string

c2

User

string

test_user

ExecuteTime

integer

5

CpuTime

integer

1

ServerIp

string

xx.xx.xx.xx

ClientIp

string

xx.xx.xx.xx

SessionId

integer

322441****

ProxySessId

string

7521015416********

Command

string

Query

Status

string

ACTIVE

SqlId

string

45CCBDC7DEBDCDAXXXXAFC********

TraceId

string

YB420XXX128-00062XXXX8313XXX1-X-X

PlanId

string

1898

DynamicSql

string

false

ProcessSqlList

array<object>

object

SqlText

string

select * from c1 where id = 100;

TenantId

string

t********

Database

string

c3

User

string

test_user

ExecuteTime

integer

5

CpuTime

integer

1

ServerIp

string

xx.xx.xx.xx

ClientIp

string

xx.xx.xx.xx

SessionId

integer

322441****

ProxySessId

string

7521015416********

Command

string

Query

Status

string

ACTIVE

SqlId

string

45CCBDC7DEBDCDAXXXXAFC********

TraceId

string

YB420XXX128-00062XXXX8313XXX1-X-X

PlanId

string

1898

DynamicSql

string

false

ServerSn

string

i-bp1*****sw64dhb*****

SessionStatistics

object

Statistik sesi yang dikelompokkan berdasarkan sumber berbeda.

UserStatistics

array<object>

The session data in the user dimension.

object

The session data in the user dimension.

MetricValue

string

The username.

test_user

ActiveCount

integer

The number of active sessions.

25

TotalCount

integer

The total number of entries returned.

30

Type

string

The dimension. This value is fixed to user.

user

SourceStatistics

array<object>

The session data in the client dimension.

object

The session data in the client dimension.

MetricValue

string

The IP address of the client.

xx.xx.xx.xx

ActiveCount

integer

The number of active sessions.

25

TotalCount

integer

The total number of entries returned.

30

Type

string

The dimension. This value is fixed to client.

client

DataBaseStatistics

array<object>

The session data in the database dimension.

object

The session data in the database dimension.

MetricValue

string

The name of the database.

test_database

ActiveCount

integer

The number of active sessions.

25

TotalCount

integer

The total number of entries returned.

30

Type

string

The dimension. This value is fixed to database.

database

ObVersion

string

Nomor versi OB.

3.2.4

Contoh

Respons sukses

JSONformat

{
  "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"
  }
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.