Memperoleh daftar log audit operasi SQL yang dilakukan di DMS.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dms:ListSQLExecAuditLog |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| StartTime |
string |
Yes |
Awal rentang waktu yang akan ditanyakan. Catatan
Anda dapat menentukan nilai fuzzy untuk waktu mulai. Tentukan waktu dalam format YYYY-MM-DD hh:mm:ss. |
2021-11-08 11:04:00 |
| EndTime |
string |
Yes |
Akhir rentang waktu yang akan ditanyakan. Catatan
Anda dapat menentukan nilai fuzzy untuk waktu akhir. Tentukan waktu dalam format YYYY-MM-DD hh:mm:ss. Kami menyarankan agar interval antara waktu mulai dan waktu akhir tidak lebih dari satu hari. Dengan cara ini, data dapat ditanyakan per halaman dan efisiensi kueri dapat ditingkatkan. |
2021-11-08 11:00:00 |
| SearchName |
string |
No |
Nama yang digunakan untuk pencarian. Catatan
Anda dapat memasukkan nama database. Jika operasi SQL dilakukan pada tingkat instans, Anda dapat memasukkan nama instans. |
test_SearchName |
| OpUserName |
string |
No |
Nama panggilan pengguna yang melakukan operasi. |
test_OpUserName |
| SqlType |
string |
No |
Tipe pernyataan SQL. Nilai umum:
Catatan
Anda dapat memilih Operation Audit > SQL Type di bilah navigasi atas konsol DMS untuk melihat lebih banyak tipe SQL. |
SELECT |
| ExecState |
string |
No |
Status eksekusi. Nilai yang valid:
|
1 |
| PageSize |
integer |
No |
Jumlah entri per halaman. Nilai maksimum: 100. |
20 |
| PageNumber |
integer |
No |
Nomor halaman untuk memulai. Tentukan nomor halaman yang valid. Jika nomor halaman yang ditentukan melebihi jumlah total halaman log, jumlah total catatan operasi mungkin bukan 0 tetapi daftar log audit operasi mungkin kosong. |
1 |
| Tid |
integer |
No |
ID penyewa. Anda dapat memanggil operasi GetUserActiveTenant untuk memperoleh ID penyewa. |
3*** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| TotalCount |
integer |
Jumlah total catatan operasi. |
1 |
| RequestId |
string |
ID permintaan. |
39BC9C86-95AE-58F2-9862-A7C3D896**** |
| ErrorCode |
string |
Kode kesalahan. |
MissingStartTime |
| ErrorMessage |
string |
Pesan kesalahan. |
StartTime is mandatory for this action. |
| Success |
boolean |
Menunjukkan apakah permintaan berhasil. Nilai yang valid:
|
true |
| SQLExecAuditLogList |
object |
||
| SQLExecAuditLog |
array<object> |
Daftar log audit operasi SQL. |
|
|
object |
Informasi tentang audit operasi SQL. |
||
| OpTime |
string |
The time when the operation specified by the SQL statement was performed on the instance or database. |
2021-11-08 11:04:27 |
| UserName |
string |
The nickname of the user who wrote the SQL statement. |
test_UserName |
| UserId |
integer |
The ID of the user who wrote the SQL statement. |
12**** |
| InstanceName |
string |
The name of the database. Catatan
If the SQL statement takes effect on an instance, the name of the instance is returned. |
polar123@pc-bp1h9tgq4st9g****.mysql.polardb.rds.aliyuncs.com:3306【polar_qw_测试】 |
| InstanceId |
integer |
The ID of the instance. |
185*** |
| SchemaName |
string |
The name of the database. |
polar123 |
| DbId |
integer |
The ID of the database. |
2157**** |
| Logic |
boolean |
Indicates whether the database is a logical database. Valid values:
|
false |
| SQLType |
string |
The type of the SQL statement. Valid values:
Catatan
To view more types of SQL statements, log on to the DMS console and click Security and Specifications. In the left-side navigation pane, click Operation Audit. Then, you can view all supported types of SQL statements from the SQL type drop-down list. |
SELECT |
| SQL |
string |
The SQL statement that was written. |
SELECT * FROM `polar123`.`p_qw` ORDER BY `id` DESC |
| ExecState |
string |
The execution status of the SQL statement. Valid values:
|
SUCCESS |
| AffectRows |
integer |
The number of rows affected by the SQL statement. For example, if you execute an SQL statement to query data, the number of retrieved rows is returned. |
2 |
| ElapsedTime |
integer |
The amount of time consumed by the execution of the SQL statement. Unit: milliseconds. |
18 |
| Remark |
string |
The comment on the SQL statement. |
success |
Contoh
Respons sukses
JSONformat
{
"TotalCount": 1,
"RequestId": "39BC9C86-95AE-58F2-9862-A7C3D896****",
"ErrorCode": "MissingStartTime",
"ErrorMessage": "StartTime is mandatory for this action.",
"Success": true,
"SQLExecAuditLogList": {
"SQLExecAuditLog": [
{
"OpTime": "2021-11-08 11:04:27",
"UserName": "test_UserName",
"UserId": 0,
"InstanceName": "polar123@pc-bp1h9tgq4st9g****.mysql.polardb.rds.aliyuncs.com:3306【polar_qw_测试】",
"InstanceId": 0,
"SchemaName": "polar123",
"DbId": 0,
"Logic": false,
"SQLType": "SELECT",
"SQL": "SELECT * FROM `polar123`.`p_qw` ORDER BY `id` DESC",
"ExecState": "SUCCESS",
"AffectRows": 2,
"ElapsedTime": 18,
"Remark": "success"
}
]
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.