We have a problem with one of our databases. At random times something causes our transaction log to swell up to 20x its original size (it basically fills up the whole HD, so 20x is not accurate since it might grow more if there was space left on disk)
We do full backup once a week and differentials every day. Our database is using SIMPLE recovery mode. I am trying to go through the transaction log of the differential and full backup files using fn_dblog and fn_dump_dblog, yet for whatever reason, in both cases it is showing me [Begin Time] and [End Time] for a very small amount of time. For differential it is showing records for a time span of only around 1/2 a minute. For the full backup, it is showing records within a span of 5-10 minutes.
Here is the query I was running, hoping from here i can find long running transaction logs from the past:
SELECT
[Current LSN], a.[Transaction ID], [Transaction Name], [Operation], [Begin Time], [End Time], SUSER_SNAME([TRANSACTION SID]) as LoginName
FROM fn_dump_dblog (NULL, NULL, N'DISK', 1, 'DB_backup_path',
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT,
DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT, DEFAULT) as a
WHERE
Operation in ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT')
order by
[Transaction ID]
Here is the query I was running to see long transaction which are still in activate transaction log:
SELECT
[Current LSN], [Transaction ID], [Transaction Name], [Operation], [Begin Time], [End Time], SUSER_SNAME([TRANSACTION SID]) as LoginName
FROM
fn_dblog(NULL, NULL)
WHERE [Operation] in ('LOP_BEGIN_XACT', 'LOP_COMMIT_XACT')
In both cases, why am I getting data only for a small span of time?
Also, on more generic level, is this the best way to investigate why on random times the transaction log grows out of control. We looked at all the reoccurring sql jobs we are running and there is nothing extra ordinary there. When we kick them off, they run for at most 5 minutes. Even running multiple jobs at the same time causes no bottlenecks. Our application does not use any transactions when it talks to DB, so we are completely confused.
Any ideas?