Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

sys.dm_tran_database_transactions: Why is log_bytes_reserved not the same as log space usage?

$
0
0

Hello,

Hopefully someone can bring some light to the topic "What is sys.dm_tran_database_transactions really showing".
I know there are some articles about this dmv, but if you dig some deeper they don't solve my question...

Scenario:
SQL Server 2012, database recovery model set to simple, ldf size=25GB

Problem:
ldf is running out of space - so I want to find the responsible process(es). If I query something like...

select session_id
       , database_transaction_log_bytes_used
       , database_transaction_log_bytes_reserved
       , database_transaction_log_bytes_used_system
       , database_transaction_log_bytes_reserved_system
from sys.dm_tran_database_transactions as A inner join sys.dm_tran_session_transactions as B on a.transaction_id=B.transaction_id
where db_name(A.database_id)='myDatabase' 

... I get a total amount of ~10MB used. dbcc sqlperf(logspace) confirms, the 25 GB ldf file is 99% used.
I noticed the same behavior with the TempDB log file.

sys.databases shows log_reuse_wait_desc ACTIVE_TRANSACTION

Question:
Can someone please explain what transactions will be shown in sys.dm_tran_database_transactions and why I cannot see the really huge transactions?

Thank you for your help!


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>