I have a query to get me some basic information regarding the transaction log (.ldf
) file. Here it is:
WITH CTE AS
(
SELECT
AllocUnitName,
Operation,
Context,
[Lock Information],
SUM(CONVERT(BIGINT, [Log Record Length])) AS TotalTranLogBytes,
SUM(CONVERT(BIGINT, [Log Record Length])) * 100 /
SUM(CONVERT(MONEY, SUM(CONVERT(BIGINT, [Log Record Length]))))
OVER() AS PercentOfLog
FROM
sys.fn_dblog(NULL,NULL)
GROUP BY
AllocUnitName,
Operation,
Context,
[Lock Information]
)
SELECT
AllocUnitName,
Operation,
Context,
[Lock Information],
TotalTranLogBytes,
PercentOfLog
FROM
CTE
WHERE
PercentOfLog >= 0
ORDER BY
TotalTranLogBytes DESC
Unfortunately, I don't actually understand the output... I'm primarily concerned with only the very top row from that query's results, it's the largest amount of space used in the transaction log, simple!
However, there are other columns, AllocUnitName
, Operation
and Context
. In my case, I get:
dbo.MyMassiveTable.PK_MyMassiveTable LOP_MODIFY_ROW LCX_TEXT_MIX 3848564 61.6838
...as my output. But what on EARTH does LOP_MODIFY_ROW
, and LCX_TEXT_MIX
actually MEAN?
Obviously I can vaguely understand that it's something to do with the primary key for that table, that it's associated with an UPDATE command, and that there was something happening with a Text column?
But I need precision!
Anyone that can help me understand why this particular part of the transaction log is so HUGE would be a great help!