Solved

SQL Logfiles over 80GB

Posted on 2013-12-06
4
378 Views
Last Modified: 2013-12-06
Hi Experts,

I have some SQL logfiles which are very big. over 80GB.
With a command I checked the log and just 1% is used.
Under options of this DB I found the feature autoshrink file.

When I use autoshrink, is this a problem ?
Or do I have some disadvantages ?
0
Comment
Question by:Eprs_Admin
  • 2
  • 2
4 Comments
 
LVL 1

Expert Comment

by:mike706
ID: 39700376
From SSMS run Task -> Shrink -> Files and shrink the Log file.
Mark the option "Reorganize pages Before releasing unused space" and set "Shrink file to".

Make sure that the Log file is not shrink to 0% available space after shrink.
This file size is depending on the amount of transactions made to the database.

Then setup a backup job with option FULL to make a backup of the database. If the Recovery Model is set to FULL on the database also make a log backup between the FULL backups.
Typically a log backup is set to every hour during the day when the transactions is made to the database. This will help to have the transaction log in shape.
0
 

Author Comment

by:Eprs_Admin
ID: 39700416
I cannot find this option :
 "Reorganize pages Before releasing unused space"
0
 
LVL 1

Accepted Solution

by:
mike706 earned 500 total points
ID: 39700469
You will find it under the Shrink files window.

What version of SQL server are you using?

You can also try to do it with a Query.

USE [Database]
GO
DBCC SHRINKFILE (N'Filename of logfile' , 2)
GO

Change the Database to the corresponding database and "Filename of logfile" to the logical name of the logfile. The number is the value in MB how big the log file should be after the shrink.

Don't forget to make backup Before Shrinking the database.
pic.PNG
0
 

Author Closing Comment

by:Eprs_Admin
ID: 39700694
Thanks my friend
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Query 2 43
Distributed Replay - When should i use it? 1 24
tempdb latch contention 12 47
SQL server is using more virtual memory. 5 63
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

943 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

10 Experts available now in Live!

Get 1:1 Help Now