THE SQL Server Blog Spot on the Web

Welcome to - The SQL Server blog spot on the web Sign in | |
in Search

Kevin Kline

Tracking Log File Growth on SQL Server 2000

Gert Drapers, whom I consider to be a super-genius of the SQL Server world and owner of the very useful website, wrote a useful little script a few years ago that I thought I'd share.  This is a SQL query that will show who and what is causing the log of a database, in this case tempdb, to grow:

USE tempdb

SELECT Operation,
   [Log Size] = SUM([Log Record Length])
FROM ::fn_dblog(null, null)
GROUP BY Operation, Context

This dumps the active part of the log in tempdb and provides an aggregate per operation and the context it occured in. The [Object Name] and [Index Name] columns provide info on which object, [Server UID], [UID] and [SPID] can provide user context when applicable.



Published Wednesday, July 11, 2007 4:37 PM by KKline
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS



Jeremy said:

Is there any way i can find out who uploaded a specific set of files onto a server? We have a bit of a problem in my work place with files being loaded onto the server and we can't delete them.

September 23, 2008 1:15 AM

Leave a Comment


About KKline

Kevin Kline is a well-known database industry expert, author, and speaker. Kevin is a long-time Microsoft MVP and was one of the founders of PASS,

This Blog



Privacy Statement