All Products
Search
Document Center

Database Autonomy Service:GetRequestDiagnosisPage

Last Updated:Jun 10, 2026

Mengkueri catatan diagnostik SQL per halaman.

Deskripsi operasi

Before you call this operation, take note of the following items:

  • If you use an SDK to call API operations of Database Autonomy Service (DAS), you must set the region ID to cn-shanghai.

  • This operation supports the following database engines:

    • ApsaraDB RDS for MySQL

    • ApsaraDB RDS for PostgreSQL

    • ApsaraDB RDS for SQL Server

    • PolarDB for MySQL

    • PolarDB for PostgreSQL (Compatible with Oracle)

    • ApsaraDB for MongoDB

Catatan

The minor engine version of the Apsara RDS for PostgreSQL instance must be 20220130 or later. For more information about how to check and update the minor engine version of an ApsaraDB RDS for PostgreSQL instance, see Update the minor engine version of an ApsaraDB RDS for PostgreSQL instance.

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

hdm:GetRequestDiagnosisPage

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instans.

rm-0iwhhl8gx0ld6****

NodeId

string

No

ID node.

Catatan

Anda harus menentukan ID node jika Instansiasi basis data Anda adalah instans PolarDB Basis Data Relasional Cloud-Native for MySQL, PolarDB Basis Data Relasional Cloud-Native for PostgreSQL (Compatible with Oracle), atau Database Apsara for MongoDB.

202****

PageNo

integer

Yes

Nomor halaman. Nilai harus berupa bilangan bulat positif. Nilai default: 1.

1

PageSize

integer

Yes

Jumlah entri per halaman. Nilai harus berupa bilangan bulat positif. Nilai default: 10.

10

StartTime

integer

Yes

Awal rentang pengatur waktu untuk dikueri. Atur parameter ini ke stempel waktu UNIX yang mewakili jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC.

1633071840000

EndTime

integer

Yes

Akhir rentang pengatur waktu untuk dikueri. Atur parameter ini ke stempel waktu UNIX yang mewakili jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC.

1634972640000

Elemen respons

Element

Type

Description

Example

object

The response parameters.

Message

string

The returned message.

Catatan

If the request was successful, Successful is returned. If the request failed, an error message that contains information such as an error code is returned.

Successful

RequestId

string

The request ID.

800FBAF5-A539-5B97-A09E-C63AB2F7****

Data

object

The returned data.

list

array<object>

The SQL diagnostics records returned.

object

messageId

string

The unique ID of the diagnostics task.

61820b594664275c4429****

uuid

string

The unique ID of the diagnostics instance.

hdm_51fe9bc19ec413f4d530431af87a****

accountId

string

The user ID.

2093****

sqlId

string

The SQL template ID.

0c95dae3afef77be06572612df9b****

engine

string

The database engine. Valid values:

  • MySQL

  • PostgreSQL

  • SQLServer

  • PolarDBMySQL

  • PolarDBOracle

  • MongoDB

MySQL

dbSchema

string

The name of the database.

das

param

string

Additional information.

{"":""}

state

integer

The status of the diagnostics task. Valid values:

  • 0: The diagnostics task is in progress.

  • 1: A diagnostics error occurred.

  • 2: The diagnostics task is complete.

  • 3: An SQL error occurred.

  • 4: An engine error occurred.

2

result

string

The result of the SQL diagnostics task. The result includes the following information:

  • endTime: the end time of the SQL diagnostics task.

  • errorCode: indicates whether the SQL diagnostics task is complete. Valid values:

    • 0001: The SQL diagnostics task is complete.

    • 0003: The SQL diagnostics task failed.

  • errorMessage: the error message.

  • estimateCost: the estimated cost.

    • cpu: the estimated CPU utilization of the index.

    • io: the estimated I/O usage of the index.

    • rows: the estimated values of the rows returned for the index.

  • improvement: the performance improvement ratio.

  • indexAdvices: the index recommendations, which include the following information:

    • columns: the index columns.

    • ddlAddIndex: the DDL statement for the index.

    • indexName: the name of the index.

    • schemaName: the name of the database.

    • tableName: the name of the table.

    • unique: indicates whether the index is unique.

  • ip: the IP address of the instance.

  • messageId: the ID of the diagnostics task.

  • port: the port used to connect to the instance.

  • sqlTag: the SQL tag.

  • startTime: the start time of the SQL diagnostics task.

  • success: indicates whether the request was successful.

  • support: indicates whether the SQL statement can be diagnosed. Valid values:

    • true: The SQL statement can be diagnosed.

    • false: The SQL statement cannot be diagnosed.

  • tuningAdvices: the SQL rewrite suggestions.

{ "endTime":1636354256000, "errorCode":"0001", "errorMessage":"TFX成功", "estimateCost":{ "cpu":1.7878745150389268, "io":9.948402604746128, "rows":8.889372575194633 }, "improvement":12933.97, "indexAdvices":[ { "columns":[ "work_no" ], "ddlAddIndex":"ALTER TABLE `test`.`work_order` ADD INDEX `idx_workno` (`work_no`)", "indexName":"idx_workno", "schemaName":"test", "tableName":"work_order", "unique":false } ], "ip":"****.mysql.rds.aliyuncs.com", "messageId":"6188c8cb2f1365b16aee****", "port":3306, "sqlTag":"{\"PRED_EQUAL\":\"Y\",\"CNT_QB\":\"1\",\"CNT_TB\":\"1\"}", "startTime":1636354252000, "success":true, "support":true, "tuningAdvices":[ ] }

gmtCreate

string

The time when the SQL diagnostics task was created. The value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1633071840000

gmtModified

string

The time when the SQL diagnostics task was modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1633071850000

pageNo

integer

The page number. The value must be a positive integer. Default value: 1.

1

pageSize

integer

The number of entries per page. The value must be a positive integer. Default value: 10.

10

total

integer

The total number of returned entries.

100

extra

string

Additional information.

{"":""}

Code

string

The HTTP status code returned.

200

Success

string

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Contoh

Respons sukses

JSONformat

{
  "Message": "Successful",
  "RequestId": "800FBAF5-A539-5B97-A09E-C63AB2F7****",
  "Data": {
    "list": [
      {
        "messageId": "61820b594664275c4429****",
        "uuid": "hdm_51fe9bc19ec413f4d530431af87a****",
        "accountId": "2093****",
        "sqlId": "0c95dae3afef77be06572612df9b****",
        "engine": "MySQL",
        "dbSchema": "das",
        "param": "{\"\":\"\"}",
        "state": 2,
        "result": "{     \"endTime\":1636354256000,     \"errorCode\":\"0001\",     \"errorMessage\":\"TFX成功\",     \"estimateCost\":{         \"cpu\":1.7878745150389268,         \"io\":9.948402604746128,         \"rows\":8.889372575194633     },     \"improvement\":12933.97,     \"indexAdvices\":[         {             \"columns\":[                 \"work_no\"             ],             \"ddlAddIndex\":\"ALTER TABLE `test`.`work_order` ADD INDEX `idx_workno` (`work_no`)\",             \"indexName\":\"idx_workno\",             \"schemaName\":\"test\",             \"tableName\":\"work_order\",             \"unique\":false         }     ],     \"ip\":\"****.mysql.rds.aliyuncs.com\",     \"messageId\":\"6188c8cb2f1365b16aee****\",     \"port\":3306,     \"sqlTag\":\"{\\\"PRED_EQUAL\\\":\\\"Y\\\",\\\"CNT_QB\\\":\\\"1\\\",\\\"CNT_TB\\\":\\\"1\\\"}\",     \"startTime\":1636354252000,     \"success\":true,     \"support\":true,     \"tuningAdvices\":[      ] }",
        "gmtCreate": "1633071840000",
        "gmtModified": "1633071850000"
      }
    ],
    "pageNo": 1,
    "pageSize": 10,
    "total": 100,
    "extra": "{\"\":\"\"}"
  },
  "Code": "200",
  "Success": "true"
}

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 InvalidParams The request parameters are invalid.
403 NoPermission You are not authorized to do this action.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.