Thursday 6 December 2012

SQL Logs Oversized - Useful Queries

DBCC OPENTRAN

-Find longest running transaction and identify the SPID

DBCC INPUTBUFFER(SPID)

-Shows the query being processed so you can assess whether it is safe to kill

sp_who2

-More info about SPID

DBCC SQLPERF ( LOGSPACE )

-Shows log size and Log Space used

sp_helpfile

-Shows log and database file locations, growth and size.