All Products
Search
Document Center

ApsaraDB for OceanBase (Deprecated):DescribeOasSQLPlans

Last Updated:Jun 12, 2026

Mengkueri informasi rencana eksekusi SQL yang disimpan dalam sistem diagnostik berdasarkan ID SQL.

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:DescribeOasSQLPlans

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID Kluster OceanBase.

ob317v4uif****

TenantId

string

Yes

ID penyewa.

t4louaeei****

StartTime

string

Yes

Waktu mulai untuk mengkueri rencana eksekusi SQL.

Waktu harus dalam UTC dengan format YYYY-MM-DDThh:mm:ssZ.

2023-04-12T04:38:38Z

EndTime

string

Yes

Waktu akhir untuk mengkueri rencana eksekusi SQL.
Waktu harus dalam UTC dengan format YYYY-MM-DDThh:mm:ssZ.

2023-04-12T05:38:38Z

DbName

string

Yes

Nama database.

test_db

SqlId

string

Yes

ID SQL.

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

AcceptLanguage

string

No

Bahasa yang didukung. Nilai valid:

  • zh-CN: Bahasa Tionghoa

  • en-US: Bahasa Inggris.

zh-CN

DynamicSql

boolean

No

Apakah SQL merupakan SQL dinamis.

false

PlanUnionHash

string

No

Pengidentifikasi unik rencana eksekusi.

c4e9aaa797428df9a5a41828********

ReturnBriefInfo

boolean

No

Apakah akan mengembalikan informasi ringkas rencana eksekusi.

true

FormatSqlId

string

No

ID SQL format.

Elemen respons

Element

Type

Description

Example

object

Parameter tanggapan.

RequestId

string

ID permintaan.

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

Data

array<object>

Daftar informasi rencana eksekusi SQL.

array<object>

Informasi rencana eksekusi SQL.

PlanHash

string

Pengidentifikasi internal rencana eksekusi SQL dalam sistem diagnostik.

1758****24913166****

Plans

array<object>

Daftar rencana eksekusi.

object

Parameter tanggapan.

Uid

string

The unique identifier of the plan.

AAAAAAAAAAI****AAFoT2QAF--7W****

PlanId

integer

The ID of the plan.

590****

FirstLoadTime

string

First time to load the plan.

2023-04-12T04:46:38Z

PlanType

string

Plan type, including LOCAL, REMOTE, DIST.

LOCAL

PlanHash

string

The internal identifier of the SQL execution plan in the diagnostic system.

-86290582****886880

PlanSize

integer

Plan size.

10****

SchemaVersion

integer

Schema version.

16838****3550464

MergedVersion

integer

Merge version.

513

ObServerId

integer

Server ID.

2

ObDbId

integer

Database ID.

11006****828

ServerId

integer

The ID of the backend server instance.

2

FirstLoadTimeUs

integer

First loading time.

1684****03289441

HitDiagnosis

boolean

Whether to hit the diagnosis.

false

OutlineData

string

The outline_data parameter of the SQL execution plan.

/*+ BEGIN_OUTLINE_DATA INDEX(@\"SEL$1\

OutlineId

integer

Outline ID.

-1

CollectTimeUs

integer

Collection time.

1684368****00000

Server

string

The server where the SQL is executed.

i-bp1db1a9us038****jio

HitPercentage

number

Hit rate.

100.0

Executions

integer

The total number of executions during the execution period.

1

ExecPs

number

The average execution count per second during the execution period.

0.31

AvgDiskReads

number

The average physical read count during the execution period.

0.0

AvgDiskWrites

number

The average physical write count during the execution period.

0.0

AvgBufferGets

number

Average cache read count during the execution period.

30137.03

AvgApplicationWaitTime

number

Average Application event waiting time (in milliseconds) during the execution period.

0.0

AvgConcurrencyWaitTime

number

Average Concurrency event waiting time (in milliseconds) during the execution period.

0.0

AvgUserIoWaitTime

number

Average UserIo event waiting time (in milliseconds) during the execution period.

0.0

AvgRowProcessed

number

Average row processing waiting time (in milliseconds) during the execution period.

1.0

AvgElapsedTime

number

Average interval waiting time (in milliseconds) during the execution period.

1876.78

AvgCpuTime

number

Average CPU time (in milliseconds) during the execution period.

1875.34

LargeQueryPercentage

number

Percentage of completed long-running queries.

0.0

DelayedLargeQueryPercentage

number

Percentage of delayed long-running queries.

0.0

TimeoutPercentage

number

Percentage of timeouts.

0.0

TableScan

boolean

Whether a full table scan is performed.

false

PlanUnionHash

string

The internal unique identifier of the SQL execution plan in the diagnostic system.

"52c7c53****53e61b3f7586b17****ad"

SqlId

string

SQL ID.

46939C87ECA****95ED0FF64F44B****

SqlText

string

MergedVersion

integer

Versi gabungan.

513

FirstLoadTime

string

Waktu pemuatan pertama.

2023-04-12T04:46:38Z

PlanType

string

Tipe rencana eksekusi.

LOCAL

HitDiagnosis

boolean

Apakah rencana mengenai diagnosis.

false

HitPercentage

number

Tingkat hit.

100.0

AvgCpuTime

number

Waktu CPU rata-rata selama periode, dalam milidetik.

1875.34

PlanExplain

object

Rencana eksekusi.

PlanJsonString

string

JSON string of the SQL execution plan.

"PlanJsonString":"{\"RootOperations\":[{\"Children\":[{\"Children\":[{\"Cost\":2000,\"ObjectName\":\"TR\",\"Operator\":\"PHY_TABLE_SCAN\",\"Property\":\"table_rows:8593, physical_range_rows:85, logical_range_rows:85, index_back_rows:0, output_rows:85, est_method:default_stat, avaiable_index_name[ALL_VIRTUAL_AGENT]\",\"Rows\":86},{\"Children\":[{\"Cost\":2000,\"ObjectName\":\"NA\",\"Operator\":\"PHY_TABLE_SCAN\",\"Property\":\"table_rows:1750, physical_range_rows:17, logical_range_rows:17, index_back_rows:0, output_rows:17, est_method:default_stat, avaiable_index_name[ALL_VIRTUAL_AGENT]\",\"Rows\":18}],\"Cost\":2013,\"ObjectName\":\"NULL\",\"Operator\":\"PHY_SORT\",\"Property\":\"NULL\",\"Rows\":18}],\"Cost\":4024,\"ObjectName\":\"NULL\",\"Operator\":\"PHY_MERGE_JOIN\",\"Property\":\"NULL\",\"Rows\":26}],\"Cost\":4025,\"ObjectName\":\"NULL\",\"Operator\":\"PHY_SCALAR_AGGREGATE\",\"Property\":\"NULL\",\"Rows\":1}]}"

Executions

integer

Jumlah eksekusi.

1

PlanUnionHash

string

Pengidentifikasi unik rencana eksekusi SQL dalam sistem diagnostik.

"52c7c53****53e61b3f7586b17****ad"

QuerySql

string

Pernyataan pencarian.

Catatan


Tidak digunakan saat ini. Nilai ini selalu kosong.

"select 1 from t"

Bounded

boolean

Apakah rencana eksekusi terikat.

false

TableScan

boolean

Apakah rencana mencakup pemindaian tabel penuh.

false

OutlineId

string

ID outline yang digunakan oleh rencana.

3********

OutlineStatus

string

Status outline yang digunakan oleh rencana. Nilai "已生效" menunjukkan bahwa outline_data rencana sepenuhnya cocok dengan outline_content outline. Nilai "未知" menunjukkan bahwa status tidak dapat ditentukan.

已生效

ByFormatSqlId

boolean

Apakah pengikatan fuzzy digunakan.

Contoh

Respons sukses

JSONformat

{
  "RequestId": "EE205C00-30E4-****-****-87E3A8A2AA0C",
  "Data": [
    {
      "PlanHash": "1758****24913166****",
      "Plans": [
        {
          "Uid": "AAAAAAAAAAI****AAFoT2QAF--7W****",
          "PlanId": 0,
          "FirstLoadTime": "2023-04-12T04:46:38Z",
          "PlanType": "LOCAL",
          "PlanHash": "-86290582****886880",
          "PlanSize": 0,
          "SchemaVersion": 0,
          "MergedVersion": 513,
          "ObServerId": 2,
          "ObDbId": 0,
          "ServerId": 2,
          "FirstLoadTimeUs": 0,
          "HitDiagnosis": false,
          "OutlineData": "/*+ BEGIN_OUTLINE_DATA INDEX(@\\\"SEL$1\\",
          "OutlineId": -1,
          "CollectTimeUs": 0,
          "Server": "i-bp1db1a9us038****jio",
          "HitPercentage": 100,
          "Executions": 1,
          "ExecPs": 0.31,
          "AvgDiskReads": 0,
          "AvgDiskWrites": 0,
          "AvgBufferGets": 30137.03,
          "AvgApplicationWaitTime": 0,
          "AvgConcurrencyWaitTime": 0,
          "AvgUserIoWaitTime": 0,
          "AvgRowProcessed": 1,
          "AvgElapsedTime": 1876.78,
          "AvgCpuTime": 1875.34,
          "LargeQueryPercentage": 0,
          "DelayedLargeQueryPercentage": 0,
          "TimeoutPercentage": 0,
          "TableScan": false,
          "PlanUnionHash": "\"52c7c53****53e61b3f7586b17****ad\"",
          "SqlId": "46939C87ECA****95ED0FF64F44B****",
          "SqlText": ""
        }
      ],
      "MergedVersion": 513,
      "FirstLoadTime": "2023-04-12T04:46:38Z",
      "PlanType": "LOCAL",
      "HitDiagnosis": false,
      "HitPercentage": 100,
      "AvgCpuTime": 1875.34,
      "PlanExplain": {
        "PlanJsonString": "\"PlanJsonString\":\"{\\\"RootOperations\\\":[{\\\"Children\\\":[{\\\"Children\\\":[{\\\"Cost\\\":2000,\\\"ObjectName\\\":\\\"TR\\\",\\\"Operator\\\":\\\"PHY_TABLE_SCAN\\\",\\\"Property\\\":\\\"table_rows:8593, physical_range_rows:85, logical_range_rows:85, index_back_rows:0, output_rows:85, est_method:default_stat, avaiable_index_name[ALL_VIRTUAL_AGENT]\\\",\\\"Rows\\\":86},{\\\"Children\\\":[{\\\"Cost\\\":2000,\\\"ObjectName\\\":\\\"NA\\\",\\\"Operator\\\":\\\"PHY_TABLE_SCAN\\\",\\\"Property\\\":\\\"table_rows:1750, physical_range_rows:17, logical_range_rows:17, index_back_rows:0, output_rows:17, est_method:default_stat, avaiable_index_name[ALL_VIRTUAL_AGENT]\\\",\\\"Rows\\\":18}],\\\"Cost\\\":2013,\\\"ObjectName\\\":\\\"NULL\\\",\\\"Operator\\\":\\\"PHY_SORT\\\",\\\"Property\\\":\\\"NULL\\\",\\\"Rows\\\":18}],\\\"Cost\\\":4024,\\\"ObjectName\\\":\\\"NULL\\\",\\\"Operator\\\":\\\"PHY_MERGE_JOIN\\\",\\\"Property\\\":\\\"NULL\\\",\\\"Rows\\\":26}],\\\"Cost\\\":4025,\\\"ObjectName\\\":\\\"NULL\\\",\\\"Operator\\\":\\\"PHY_SCALAR_AGGREGATE\\\",\\\"Property\\\":\\\"NULL\\\",\\\"Rows\\\":1}]}\""
      },
      "Executions": 1,
      "PlanUnionHash": "\"52c7c53****53e61b3f7586b17****ad\"",
      "QuerySql": "\"select 1 from t\"",
      "Bounded": false,
      "TableScan": false,
      "OutlineId": "3********",
      "OutlineStatus": "已生效",
      "ByFormatSqlId": false
    }
  ]
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.