All Products
Search
Document Center

Database Autonomy Service:GetErrorRequestSample

Last Updated:Jun 10, 2026

Mengkueri secara asinkron informasi tentang kueri SQL yang gagal dalam data Penjelajah SQL. Anda dapat mengkueri hingga 20 kueri SQL yang gagal dalam rentang pengatur waktu tertentu.

Deskripsi operasi

Catatan

GetErrorRequestSample is an asynchronous operation. After a request is sent, the complete results are not returned immediately. If the value of isFinish is false in the response, wait for 1 second and then send a request again. If the value of isFinish is true, the complete results are returned.

  • This API operation supports only ApsaraDB RDS for MySQL instances and PolarDB for MySQL clusters for which Database Autonomy Service (DAS) Enterprise Edition is enabled. For more information, see Purchase DAS Enterprise Edition.

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

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

get

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

ID instans.

rm-2ze8g2am97624****

NodeId

string

No

ID node.

Catatan

Anda harus menentukan ID node jika database Instans Anda adalah kluster PolarDB Basis Data Relasional Cloud-Native for MySQL.

pi-bp179lg03445l****

SqlId

string

No

ID kueri SQL. Anda dapat memanggil operasi GetAsyncErrorRequestListByCode untuk mengkueri ID kueri SQL yang mengembalikan kode kesalahan MySQL.

2cd4432556c3dab9d825ba363637****

Start

integer

No

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

Catatan

Waktu mulai harus berada dalam durasi penyimpanan fitur Penjelajah SQL database Instans, dan dapat hingga 90 hari lebih awal dari pengatur waktu saat ini.

1642556990714

End

integer

No

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

Catatan

Waktu akhir harus lebih lambat dari waktu mulai. Interval tidak boleh melebihi 24 jam.

1642566830000

DbName

string

No

Nama database.

testdb01

Elemen respons

Element

Type

Description

Example

object

Code

integer

The HTTP status code returned.

200

Message

string

The returned message.

Catatan

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

Successful

Data

array<object>

The returned data.

[ { "sqlId": "2cd4432556c3dab9d825ba363637****", "database": "dbgateway", "originHost": "172.16.1****", "tables": [ "meter_****" ], "instanceId": "rm-2ze8g2am97624****", "errorCode": "1062", "user": "dbgat****", "sql": "insert into meter_****\n ( \n ****\n )\n values (now(), now(), 'bbbc8624-5e19-455a-9714-8466f688****', '2022-02-10 14:00:00', '{\"endTime\":\"2022-02-10 14:00:00\",\"endTimestamp\":1644472800,\"startTime\":\"2022-02-10 13:00:00\",\"startTimestamp\":1644469200}', null, null)", "timestamp": 1644476100435 }]

object

sqlId

string

The SQL query ID.

2cd4432556c3dab9d825ba363637****

database

string

The database name.

dbgateway

originHost

string

The IP address of the client that executes the SQL statement.

172.16.1****

tables

array

The table information.

string

The table name.

meter_****

instanceId

string

The instance ID.

rm-2ze8g2am97624****

errorCode

string

The error code that is returned.

1062

user

string

The username of the account that is used to log on to the database.

dbgat****

sql

string

The SQL statement.

insert into meter_****

timestamp

integer

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

1644476100435

RequestId

string

The request ID.

7172BECE-588A-5961-8126-C216E16B****

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Contoh

Respons sukses

JSONformat

{
  "Code": 200,
  "Message": "Successful",
  "Data": [
    {
      "sqlId": "2cd4432556c3dab9d825ba363637****",
      "database": "dbgateway",
      "originHost": "172.16.1****",
      "tables": [
        "meter_****"
      ],
      "instanceId": "rm-2ze8g2am97624****",
      "errorCode": "1062",
      "user": "dbgat****",
      "sql": "insert into meter_****",
      "timestamp": 1644476100435
    }
  ],
  "RequestId": "7172BECE-588A-5961-8126-C216E16B****",
  "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.