One sharepoint database transaction log file and backup is getting huge, sharepoint admin turned off the auditing and other features and still having big tran log generated every day. I dig into it and found what is responsible:
Thanks to this:
https://blog.coeo.com/inside-the-transaction-log-file
SELECT
[Operation],
count(*) AS [No of Records],
SUM([Log Record Length]/1024.00/1024.00) AS [RecordSize (MB)]
FROM fn_dblog(NULL,NULL)
GROUP BY Operation
ORDER BY [RecordSize (MB)] DESC
select name,is_auto_shrink_on, * FROM sys.databases
Turn off the autoShrink fixed the problem.
If the cause is DML, you can find what table is it.
SELECT
[Operation]
,SUM([Log Record Length]/1024.00/1024.00) AS [RecordSize (MB)]
,count(*) OperationCount
,[AllocUnitName]
--,[Begin Time]
--,[End Time]
,[Transaction Name]
--,[Transaction SID]
--,[Transaction Begin]
--,[Number of Locks]
--,[Lock Information]
--,[Description]
--,[Log Record]
FROM sys.fn_dblog(null,null)
--WHERE [Transaction ID] = '0000:00011043'
group by [Operation],[AllocUnitName],[Transaction Name]
order by SUM([Log Record Length]/1024.00/1024.00) desc
Comments
Post a Comment