Mengkueri detail deadlock instans ApsaraDB RDS for SQL Server.
Deskripsi operasi
-
This operation is applicable only to ApsaraDB RDS for SQL Server instances.
-
If you use an Alibaba Cloud SDK or Database Autonomy Service (DAS) SDK to call this operation, we recommend that you use the latest version of the SDK.
-
If you use an SDK to call the API operations of DAS, you must set the region ID to cn-shanghai.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetDeadLockDetailList |
list |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID Instansiasi basis data. |
rm-2ze2016723b32**** |
| StartTime |
string |
Yes |
Awal rentang pengatur waktu untuk dikueri. Atur parameter ini ke Stempel waktu UNIX yang merepresentasikan jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC. |
1701755730292 |
| EndTime |
string |
Yes |
Akhir rentang pengatur waktu untuk dikueri. Atur parameter ini ke Stempel waktu UNIX yang merepresentasikan jumlah milidetik yang telah berlalu sejak 1 Januari 1970, 00:00:00 UTC. |
1702360530292 |
| PageNo |
string |
No |
Nomor halaman. Nilai harus berupa bilangan bulat yang lebih besar dari 0. Nilai default: 1. |
1 |
| PageSize |
string |
No |
Jumlah entri per halaman. Nilai default: 10. |
5 |
| DbNameList |
string |
No |
Nama database. Saat Anda menentukan beberapa database, Anda harus memisahkan nama database dengan koma (,). |
testdb1,testdb2 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| Code |
string |
The HTTP status code returned. |
200 |
| Message |
string |
The returned message. Catatan
If the request is successful, Successful is returned. Otherwise, an error message such as an error code is returned. |
Successful |
| Data |
object |
The data returned. |
|
| List |
array<object> |
The details of the data returned. |
|
|
array<object> |
The details of the data returned. |
||
| BatchId |
integer |
The time when the data was collected. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301170701 |
| BlockProcessList |
array<object> |
The blocking details of the instance. The details are information about the session that caused the lock. |
|
|
object |
|||
| ClientApp |
string |
The name of the client that initiates the transaction in the session. |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
The hostname. |
sd7402**** |
| LastTranStarted |
integer |
The time when the transaction was started. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301152000 |
| LockMode |
string |
The mode of the lock. For more information, see Lock modes. |
U |
| LogUsed |
integer |
The size of the logs generated in the session. Unit: bytes. |
352 |
| LoginName |
string |
The logon name of the user. |
sd7402****\\Administrator |
| ObjectOwned |
string |
The locked object. |
testdb1.dbo.test2 |
| ObjectRequested |
string |
The object that the transaction requested to lock. |
testdb1.dbo.test1 |
| OwnMode |
string |
The lock mode held by the session. For more information, see Lock modes. |
X |
| Spid |
integer |
The ID of the session in which the transaction is started. |
61 |
| SqlText |
string |
The SQL statement. |
update test1 set col1 =9 |
| Status |
string |
The status of the transaction. |
suspended |
| Victim |
integer |
Indicates whether the session is the victim of the deadlock. Valid values:
|
0 |
| WaitMode |
string |
The lock mode requested by the session. For more information, see Lock modes. |
U |
| WaitResource |
string |
The resources requested by the transaction. |
RID: 5:1:312:0 |
| WaitResourceDescription |
string |
The details of the resources requested by the transaction. |
RID:school:school.mdf:312:0 |
| DatabaseName |
string |
The name of the database. |
testdb1 |
| ClientApp |
string |
The name of the client. |
Microsoft SQL Server Management Studio - Query |
| HostName |
string |
The hostname. |
sd7402**** |
| LastTranStarted |
integer |
The time when the transaction was started. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1702301141000 |
| LockMode |
string |
The mode of the lock. For more information, see Lock modes. |
U |
| LogUsed |
integer |
The size of the logs generated in the session. Unit: bytes. |
352 |
| LoginName |
string |
The logon name of the user. |
sd7402****\\Administrator |
| ObjectRequested |
string |
The object that the transaction requested to lock. |
testdb1.dbo.test2 |
| ObjectOwned |
string |
The locked object. |
testdb1.dbo.test1 |
| OwnMode |
string |
The lock mode held by the session. For more information, see Lock modes. |
X |
| Spid |
integer |
The ID of the session in which the transaction is started. |
56 |
| SqlText |
string |
The SQL statement. |
update test2 set col1 =88 |
| Status |
string |
The status of the transaction. |
suspended |
| Victim |
integer |
Indicates whether the session is the victim of the deadlock. Valid values:
|
1 |
| WaitMode |
string |
The lock mode requested by the session. For more information, see Lock modes. |
U |
| WaitResource |
string |
The resources requested by the transaction. |
RID: 5:1:376:0 |
| WaitResourceDescription |
string |
The details of the resources requested by the transaction. |
RID:school:school.mdf:376:0 |
| DatabaseName |
string |
The name of the database. |
testdb1 |
| PageNo |
integer |
The page number. |
1 |
| PageSize |
integer |
The number of entries per page. |
10 |
| Total |
integer |
The total number of entries returned. |
2 |
| RequestId |
string |
The request ID. |
840F51F7-9C01-538D-94F6-AE712905**** |
| Success |
string |
Indicates whether the request is successful. Valid values:
|
true |
Contoh
Respons sukses
JSONformat
{
"Code": "200",
"Message": "Successful",
"Data": {
"List": [
{
"BatchId": 1702301170701,
"BlockProcessList": [
{
"ClientApp": "Microsoft SQL Server Management Studio - Query",
"HostName": "sd7402****",
"LastTranStarted": 1702301152000,
"LockMode": "U",
"LogUsed": 352,
"LoginName": "sd7402****\\\\Administrator",
"ObjectOwned": "testdb1.dbo.test2",
"ObjectRequested": "testdb1.dbo.test1",
"OwnMode": "X",
"Spid": 61,
"SqlText": "update test1 set col1 =9",
"Status": "suspended",
"Victim": 0,
"WaitMode": "U",
"WaitResource": "RID: 5:1:312:0",
"WaitResourceDescription": "RID:school:school.mdf:312:0",
"DatabaseName": "testdb1"
}
],
"ClientApp": "Microsoft SQL Server Management Studio - Query",
"HostName": "sd7402****",
"LastTranStarted": 1702301141000,
"LockMode": "U",
"LogUsed": 352,
"LoginName": "sd7402****\\\\Administrator",
"ObjectRequested": "testdb1.dbo.test2",
"ObjectOwned": "testdb1.dbo.test1",
"OwnMode": "X",
"Spid": 56,
"SqlText": "update test2 set col1 =88",
"Status": "suspended",
"Victim": 1,
"WaitMode": "U",
"WaitResource": "RID: 5:1:376:0",
"WaitResourceDescription": "RID:school:school.mdf:376:0",
"DatabaseName": "testdb1"
}
],
"PageNo": 1,
"PageSize": 10,
"Total": 2
},
"RequestId": "840F51F7-9C01-538D-94F6-AE712905****",
"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.