Consulta os detalhes de deadlock de uma instância ApsaraDB RDS for SQL Server.
Descrição da operação
-
Esta operação é aplicável apenas a instâncias ApsaraDB RDS for SQL Server.
-
Se você usar um SDK da Alibaba Cloud ou um SDK do Database Autonomy Service (DAS) para chamar esta operação, recomendamos que use a versão mais recente do SDK.
-
Se você usar um SDK para chamar as operações de API do DAS, deverá definir o ID da região como cn-shanghai.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
hdm:GetDeadLockDetailList |
list |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| InstanceId |
string |
Sim |
O ID da instância de banco de dados. |
rm-2ze2016723b32**** |
| StartTime |
string |
Sim |
O início do intervalo de tempo a ser consultado. Defina este parâmetro como um timestamp UNIX que representa o número de milissegundos decorridos desde 1º de janeiro de 1970, 00:00:00 UTC. |
1701755730292 |
| EndTime |
string |
Sim |
O fim do intervalo de tempo a ser consultado. Defina este parâmetro como um timestamp UNIX que representa o número de milissegundos decorridos desde 1º de janeiro de 1970, 00:00:00 UTC. |
1702360530292 |
| PageNo |
string |
Não |
O número da página. O valor deve ser um inteiro maior que 0. Valor padrão: 1. |
1 |
| PageSize |
string |
Não |
O número de entradas por página. Valor padrão: 10. |
5 |
| DbNameList |
string |
Não |
O nome do banco de dados. Ao especificar vários bancos de dados, você deve separar os nomes dos bancos de dados com vírgulas (,). |
testdb1,testdb2 |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| Code |
string |
O código de status HTTP retornado. |
200 |
| Message |
string |
A mensagem retornada. Nota
Se a solicitação for bem-sucedida, Successful será retornado. Caso contrário, uma mensagem de erro, como um código de erro, será retornada. |
Successful |
| Data |
object |
Os dados retornados. |
|
| List |
array<object> |
Os detalhes dos dados retornados. |
|
|
array<object> |
Os detalhes dos dados retornados. |
||
| 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 |
O número da página. |
1 |
| PageSize |
integer |
O número de entradas por página. |
10 |
| Total |
integer |
O número total de entradas retornadas. |
2 |
| RequestId |
string |
O ID da solicitação. |
840F51F7-9C01-538D-94F6-AE712905**** |
| Success |
string |
Indica se a solicitação foi bem-sucedida. Valores válidos:
|
true |
Exemplos
Resposta de sucesso
JSON formato
{
"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"
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.