Solved

How to use SQL Transaction log to analyze high usage.

Posted on 2016-10-19
5
62 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 49

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:
Scott Pletcher 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 9

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 49

Expert Comment

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

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

730 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