Solved

Sql 2012 log file huge

Posted on 2012-12-21
5
2,119 Views
Last Modified: 2013-05-29
Hello,
I'm running a SQL 2012 Always-On Group with a DB inside.
The DB is set to Full logging.  However after doing a full backup the log file is not going down in size.
0
Comment
Question by:casit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 22

Assisted Solution

by:Steve Wales
Steve Wales earned 250 total points
ID: 38713453
Full backups aren't what cause a log file to be able to be shrunk.

You need to do a transaction log backup in order to flag it for reuse.

Have a read of these two blog entries from Kimberly Tripp:

http://www.sqlskills.com/blogs/kimberly/post/8-steps-to-better-transaction-log-throughput.aspx
http://www.sqlskills.com/blogs/kimberly/post/transaction-log-vlfs-too-many-or-too-few.aspx

Oh, and here's the relevant piece from SQL Server 2012 Books Online:
http://msdn.microsoft.com/en-us/library/ms190925.aspx
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 38713706
Exactly. Full Recovery Mode requires to perform DB and Transaction Log backups. Usually you perform the log backup more often (say once every 4 hours), while the DB backup is once a day or even less often. It doesn't matter whether the DB backup is differential or full.
0
 

Author Comment

by:casit
ID: 38713878
I did both a full backup and also a trans log backup and the size is still the same.
0
 
LVL 22

Expert Comment

by:Steve Wales
ID: 38713931
The transaction log backup in and of itself won't shrink the log file - it just enables the space to be reused.  If you had never done a log backup before and the log file had grown large, extra steps need to be taken to shrink the logfile and then regrow in a controlled manner to a better size.

The two blog posts I listed above cover this in great detail and I don't want to steal Kimberly's work by replicating it here.   Have a read of those two posts and come back here with any other questions.

It's important to understand the impact of large numbers of VLF's brought about by incorrect sizing of your transaction log through autogrow, the impact autogrow can have on performance as well as the proper steps to shrink the transaction log back to a reasonable size.
0
 
LVL 43

Accepted Solution

by:
Eugene Z earned 250 total points
ID: 38715752
you are probably have active transaction there
run this query to see it:

select name, database_id, log_reuse_wait, log_reuse_wait_desc from sys.databases

more:

Unable to shrink the transaction log of SQL Server database

http://zarez.net/?p=913
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

690 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