SELECT DTST.[session_id],
DES.[login_name] AS [Login Name],
DB_NAME (DTDT.database_id) AS [Database],
DTDT.[database_transaction_begin_time] AS [Begin Time],
-- DATEDIFF(ms,DTDT.[database_transaction_begin_time], GETDATE()) AS [Duration ms],
CASE DTAT.transaction_type
WHEN 1 THEN 'Read/write'
WHEN 2 THEN 'Read-only'
WHEN 3 THEN 'System'
WHEN 4 THEN 'Distributed'
END AS [Transaction Type],
CASE DTAT.transaction_state
WHEN 0 THEN 'Not fully initialized'
WHEN 1 THEN 'Initialized, not started'
WHEN 2 THEN 'Active'
WHEN 3 THEN 'Ended'
WHEN 4 THEN 'Commit initiated'
WHEN 5 THEN 'Prepared, awaiting resolution'
WHEN 6 THEN 'Committed'
WHEN 7 THEN 'Rolling back'
WHEN 8 THEN 'Rolled back'
END AS [Transaction State],
DTDT.[database_transaction_log_record_count] AS [Log Records],
DTDT.[database_transaction_log_bytes_used] AS [Log Bytes Used],
DTDT.[database_transaction_log_bytes_reserved] AS [Log Bytes RSVPd],
DEST.[text] AS [Last Transaction Text],
DEQP.[query_plan] AS [Last Query Plan]
FROM sys.dm_tran_database_transactions DTDT
INNER JOIN sys.dm_tran_session_transactions DTST
ON DTST.[transaction_id] = DTDT.[transaction_id]
INNER JOIN sys.[dm_tran_active_transactions] DTAT
ON DTST.[transaction_id] = DTAT.[transaction_id]
INNER JOIN sys.[dm_exec_sessions] DES
ON DES.[session_id] = DTST.[session_id]
INNER JOIN sys.dm_exec_connections DEC
ON DEC.[session_id] = DTST.[session_id]
LEFT JOIN sys.dm_exec_requests DER
ON DER.[session_id] = DTST.[session_id]
CROSS APPLY sys.dm_exec_sql_text (DEC.[most_recent_sql_handle]) AS DEST
OUTER APPLY sys.dm_exec_query_plan (DER.[plan_handle]) AS DEQP
ORDER BY DTDT.[database_transaction_log_bytes_used] DESC;
分享到:
相关推荐
Plate Rolling Order Transaction Log.xls
之前一直找原因,最后知道了解决方法,具体请下载源码查看。特别是用到throw的事务中
This covers performing transaction log backup and restore, monitoring and managing log growth, including quick diagnosis of the causes of rapid growth, and optimizing log architecture to maximize log ...
Principles of transaction processing Copyright © 2009 by Elsevier Inc. All rights reserved
PLATE ROLLING ORDER TRANSACTION LOG(表格模板、XLS格式).XLS
SALVAGE PLATE DIVERTING TRANSACTION LOG(表格模板、XLS格式).XLS
SAP transaction code list of PP module
Principles of Transaction Processing for the Systems Professional explains that these and many other computerized tasks require the use of transaction processing (TP).
Preparation of Papers for IEEE TRANSACTIONS and JOURNALS
SQL Server Transaction Log Management
IEEE Transactions Latex Template
Intelligent monitoring and fault management for muscle relaxation anaesthesia
解决了出现5102的问题
Good transaction design is an important facet of highly-concurrent applications that are run by hundreds, even thousands of users who are all executing transactions at the same time. Transaction ...
Principles of Transaction Processing 2Ed
sybase transaction log 分析工具
顶级投行、金融估值建模培训资料-Precedent Transaction Analysis _ Street Of Walls.pdf
Transaction discarded because of previous errors..
view transaction log for database operating, for sql server 2005 also contain before version