tsql - Explanation for the fn_dblog() function's output on SQL Server 2008 R2 -
i have query me basic information regarding transaction log (.ldf
) file. here is:
with cte ( select allocunitname, operation, context, [lock information], sum(convert(bigint, [log record length])) totaltranlogbytes, sum(convert(bigint, [log record length])) * 100 / sum(convert(money, sum(convert(bigint, [log record length])))) over() percentoflog sys.fn_dblog(null,null) group allocunitname, operation, context, [lock information] ) select allocunitname, operation, context, [lock information], totaltranlogbytes, percentoflog cte percentoflog >= 0 order totaltranlogbytes desc
unfortunately, don't understand output... i'm concerned top row query's results, it's largest amount of space used in transaction log, simple!
however, there other columns, allocunitname
, operation
, context
. in case, get:
dbo.mymassivetable.pk_mymassivetable lop_modify_row lcx_text_mix 3848564 61.6838
...as output. on earth lop_modify_row
, , lcx_text_mix
mean?
obviously can vaguely understand it's primary key table, it's associated update command, , there happening text column?
but need precision!
anyone can me understand why particular part of transaction log huge great help!
this indicates table contains column of large object datatype subject insert or update activity (i.e. max
datatype, xml
, clr datatype or image
or [n]text
).
dbo.mymassivetable.pk_mymassivetable
must either clustered index or non clustered index include
-s 1 or more lob columns.
lcx_text_mix
presumably indicates text mix page:
a text page holds small chunks of lob values plus internal parts of text tree. these can shared between lob values in same partition of index or heap.
lop_modify_row
appears in log when value updated example below shows insert can reproduce same logging outcome.
create table dbo.mymassivetable ( pk int identity constraint pk_mymassivetable primary key, blob1 nvarchar(max) ) insert dbo.mymassivetable values (replicate(cast(n'x' varchar(max)), 3848564 / 2));
Comments
Post a Comment