Sql Server How to find the oldest Active transaction
- Posted by Sqltimes
- On December 10, 2014
- 0 Comments
Quick one today:
Sometimes during normal DBA operations, there would be a need to check for the existence of any active transaction that could be preventing the transaction log from rolling forward with its virtual logs. There is a good command that helps you pull up that exact transaction.
1
2
3
4
5
|
-- -- Check oldest active transaction -- DBCC OPENTRAN GO |
As you can see the result has the session_ID and other details related to the oldest transaction. They are helpful in taking the next steps resolving the issues. If you prefer, the result could be returned in a table format. Just use TABLERESULT as shows below.
1
2
|
DBCC OPENTRAN WITH TABLERESULTS GO |
Hope this helps,
_Sqltimes
_Sqltimes
0 Comments