Solved

How to use SQL Transaction log to analyze high usage.

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

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 8

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 47

Expert Comment

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

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Live Storage Vmotion VMs with shared VMDK 10 55
Query Syntax 17 32
insert wont work in SQL 14 19
SQL Syntax: How to force case sensitive query? 2 23
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

786 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