Solved

How to use SQL Transaction log to analyze high usage.

Posted on 2016-10-19
5
38 Views
Last Modified: 2016-11-09
Something was running hard against a database and caused our transaction file to fill and expand repeatedly.

What is the best way to analyze the transaction file to find information about the transactions that were causing the problem?

At this point the transaction file has been backed up.
0
Comment
Question by:MikeMOD
5 Comments
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 41853642
At this point the transaction file has been backed up.
That means the transaction log has been truncated and any relevant information just gone.
With that said I think you can't investigate anymore what happened.
Next time better think to do is to launch a SQL Profiler to capture the current activity so you can see what's happening in the SQL Server instance.
0
 
LVL 26

Expert Comment

by:Zberteoc
ID: 41853871
Or use this:

http://sqlblog.com/blogs/adam_machanic/archive/2012/03/22/released-who-is-active-v11-11.aspx

just run the script you download to create the sp_whoisactive stored procedure and then you just execute it to see what is going on on the server:

EXEC sp_whoisactive

Details here:

https://www.brentozar.com/archive/2010/09/sql-server-dba-scripts-how-to-find-slow-sql-server-queries/
0
 
LVL 69

Accepted Solution

by:
ScottPletcher earned 500 total points
ID: 41853944
The default trace can show when a log grew.  Sometimes just knowing the times of log extensions can help you determine what caused the issue.

Within the trace, EventClass = 93 is "log file autogrow", so look for those class events in the default trace.

You can use function:
fn_trace_gettable
to read the trace file(s).

Typically that trace data stays around a while, assuming you allowed roll-over files.
0
 
LVL 7

Expert Comment

by:Jason clark
ID: 41859836
If the above solutions doesn't work for you then you can also try  the Transact-SQL TRY…CATCH construct. For more information with examples that include transactions, see: https://technet.microsoft.com/en-us/library/ms175976(v=sql.110).aspx
0
 
LVL 45

Expert Comment

by:Vitor Montalvão
ID: 41880055
MikeMOD, a feedback will be appreciated.
Cheers
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now