Skip to content

Commit

Permalink
Inclusão query consulta erros BD
Browse files Browse the repository at this point in the history
Inclusão query consulta erros BD
  • Loading branch information
luizvitorf committed Jan 8, 2020
1 parent 704d5ce commit a5908f2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Tuning/XEvent/SP Log XEvent Erros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,26 @@ WITH (MAX_DISPATCH_LATENCY = 5SECONDS)
ALTER EVENT SESSION what_queries_are_failing
ON SERVER STATE = START


/*
-- Retorna os Erros do BD - Para validar
USE Traces

SELECT D.name, COUNT(*) AS Qtd
FROM Log_DB_Error L (NOLOCK)
JOIN sys.databases D ON L.database_id = D.database_id
WHERE
err_timestamp >= '20200107 12:00'
AND err_timestamp < '20200108'
GROUP BY D.name
ORDER BY Qtd DESC

SELECT D.name, L.*
FROM Log_DB_Error L (NOLOCK)
JOIN sys.databases D ON L.database_id = D.database_id
WHERE
err_timestamp >= '20200107 12:00'
AND err_timestamp < '20200108'
ORDER BY err_timestamp DESC
*/


0 comments on commit a5908f2

Please sign in to comment.